Rails
3 to Rails 4 Migrations
Ruby
Version
|
2.2.2
|
Rails
Version
|
4.2.3
|
Modification files
|
|
1)Gemfile
|
Latest Gems related versions
|
2)Routes
|
Change the match method with via get or post
|
3)Controllers
|
New params creating and updating the data.
i)params.require(:person).permit(:name, :age)
|
4)Models
|
Active Record queries need to change
i)Profile.where(“code is not null”)
Profile.where.not(code: null)
ii)Write the scopes in Models
|
5)Javascripts,stylesheets,images_paths
|
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
|
Great post Chinna!!! this code really helpful for Ruby on Rails experts in India.
ReplyDelete