- Must be on Ruby 1.9.3 or higher.
- Upgrade Tools
- Run rake rails:update as quick way to upgrade in place. Check your Git diff afterwards.
- Use RailsDiff to compare changes between your version of Rails and Rails 4.0.0.
- Upgrade Tips
I found it easiest to create a new Rails skeleton app and use it as my index when toggling between the Rails 4.0.0 skeleton and the older Rails 3.x.x app. You can then use Git to compare and adjust differences for each file copied and pasted.
When using the above technique, the following files are worth simply copying and pasting and then using Git to compare differences for anything you might not want to loose:
View GitHub Profile
|# mysql-style output for an array of ActiveRecord objects|
|# report(records) # displays report with all fields|
|# report(records, :field1, :field2, ...) # displays report with given fields|
|# >> report(records, :id, :amount, :created_at)|
|# | id | amount | created_at ||
|class MyAPI < Grape::API|
|class CrossOriginResourceSharingPolicy < Grape::Middleware::Base|
|headers['Access-Control-Allow-Origin'] = env['HTTP_ORIGIN'] || '*'|
|headers['Access-Control-Allow-Credentials'] = 'true'|
|headers['Access-Control-Max-Age'] = '180'|
|headers['Access-Control-Allow-Headers'] = env['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']|
|headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, DELETE, OPTIONS'|