Skip to main content

Git branch and basic commands and rails3 to rails4

Rails 3 to Rails 4 Migrations

Ruby Version
Rails Version
Modification files

Latest Gems related versions
Change the match method with via get or post
New params creating and updating the data.
i)params.require(:person).permit(:name, :age)

Active Record queries need to change
i)Profile.where(“code is not null”)
Profile.where.not(code: null)
ii)Write the scopes in Models
Move the javascriptfiles and stylesheets to assets folder
6)Facebook,Linkedin,Twitter apis need to change
Code changes Latest versions of the API

Git Related Commands

git branch
List of branches for the git
git chekout -b newbranchname(Like rails4_migration)
Creating the new branch
git checkout branchname(Like rails4_migration)
Switching branche one branch to another branch
git fetch
It will pull the all branches in git
git pull
Pull the particular branch
git add . (or) git add file_name
Add the what are the files need to be push
git commit -m “purpose of commit”
Commit the code
git push origin branchname
Push the code to git
git stash (or) git checkout
Local changes Not required
git statsh pop
It will merge the local and server files.If conflicts are there it will display the file names.
Files inside the << updated stream
git branch -d branchname(Like rails4_migration)
Delete the git branch
Mandatory:While deleting the branch move to another branch.If you are same branch you cannot delete the branch


Post a Comment

Popular posts from this blog

Get user accessing ip address in rails?

Get user accessing ip address rails?

request.ip ->returns the ip, whether is is a local proxy ip (localhost address) or not.
*request.remote_ip -> is smarter and gets the ip address of the client outside of local proxies.
3)If you are using apache in front of a mongrel, then remote_ip will return the source address of the request, which in this case will be local host because the Apache web server is making the request, so instead put this in your controller:

@remote_ip = request.env["HTTP_X_FORWARDED_FOR"]

Gem::LoadError (Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).?

Gem::LoadError (Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).) In rails?

1)change the gemfile in mysql version
 gem 'mysql2'

2)Change to mysql2 version
 gem 'mysql2','0.3.20'

PayUMoney Integration in Ruby on Rails

PayUMoney Integration in Ruby on Rails

Generating Cheksum in Payu
   Hash or Checksum
= sha512(key|txnid|amount|productinfo|firstname|email|u

Controller Code Will be
def payumoney
  @key = "gtKFFx"
  @salt =  "eCwWELxi"
  val = "#{key|txnid|amount|productinfo|firstname|email|u
 @checksum = Digest::SHA512.hexdigest("#{val}")

<form action="" method='post' id='sub'  >
    <input type="hidden" name="key" value="<%=@key%>">
    <input type="hidden" name="hash" value="<%=@checksum%>">
    <input type="hidden" name="txnid" value="TXN1234">
    <input type="hidden" name="amount" value="200">
    <input type="hidden" name="firstname" value=&quo…