Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Long Ball: Upgrading Rails from 1.2 -> 4.0

The Long Ball: Upgrading Rails from 1.2 -> 4.0

RailsConf 2013 - Explore tips to upgrade from each major version to the other, and how to efficiently tackle a 1.2 -> 4.0 upgrade through two different case studies.
The velocity of change for Rails versions has a side effect -- businesses hesitate to update to the latest version until their productivity drops and they're forced to update. What happens then? Let's explore a case study of a Rails app that followed this pattern.

Jesse Wolgamott

May 02, 2013
Tweet

More Decks by Jesse Wolgamott

Other Decks in Programming

Transcript

  1. The Long Ball: Upgrading Rails From 1.2 → 4.0 Jesse

    Wolgamott | @jwo Thursday, May 2, 13
  2. there are many Rails 2.3 applications out there right now,

    chugging away and providing business value. Thursday, May 2, 13
  3. <%= link_to_remote 'Mark as Complete', :update =>, 'task-status-' + @task.id.to_s,

    :url => {:controller => 'task', :action => 'mark_complete', :id => @task } %> http://viget.com/extend/getting-started-with-rjs-in-rails Thursday, May 2, 13
  4. svn import . svn://localhost/blab -m "initial import" -- username rbates

    cd ../ svn co svn://localhost/blab/trunk blab cd blab cp config/database_example.yml config/database.yml svn propset svn:ignore database.yml config/ svn propset svn:ignore "*" log/ svn propset svn:ignore "*" tmp/ http://railscasts.com/episodes/36-subversion-on-rails Thursday, May 2, 13
  5. Rails::Initializer.run do |config| config.gem "haml" config.gem "chronic", :version => '0.2.3'

    config.gem "hpricot", :source => "http:// code.whytheluckystiff.net" config.gem "aws-s3", :lib => "aws/s3" end rake gems:install http://archives.ryandaigle.com/articles/2008/4/1/what-s- new-in-edge-rails-gem-dependencies Thursday, May 2, 13
  6. User.find(:all, :limit => 1) User.find(:all) User.find(:first) User.first(:conditions => {:name =>

    'lifo'}) User.all(:joins => :items) http://m.onkey.org/active-record-query-interface Thursday, May 2, 13
  7. Article.where("published_at <= ?", Time.now).includes(:comments) scope :published, lambda { where(published: true)}

    Article.first http://railscasts.com/episodes/202-active-record-queries-in- rails-3 Thursday, May 2, 13
  8. Railscasts::Application.routes.draw do root :to => "episodes#index" resources :spam_checks resources :spam_reports

    do member do post :confirm end end end http://railscasts.com/episodes/226-upgrading-to-rails-3- part-2 Thursday, May 2, 13
  9. • Wicked Awesome Postgres Features • Cooler Caching & strong_parameters

    • Turbolinks • Best Rails I’ve used Thursday, May 2, 13
  10. The Decision to Rewrite is not a technical decision -

    it is a organizational decision Thursday, May 2, 13
  11. Rails 2.3 Rails 3.0 Rails 3.1 Rails 4.0 Gems Router

    JavaScript Queries CSS JavaScript Forms Thursday, May 2, 13
  12. • Get to Rails 2.3 with bundler • Get to

    Rails 3.0 with Arel • Get to Rails 3.1 with Asset Pipeline • Get to Rails 4.0 with Gemfile updates Thursday, May 2, 13
  13. • Tip! use featured extracted gems during your 3.0 upgrade

    • prototype_rails • rails_autolink • deprecated_finders Thursday, May 2, 13