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

Upgrading Rails Redux

Upgrading Rails Redux

A refresh of my talk on upgrading Rails.

Avatar for Nathan Youngman

Nathan Youngman

January 19, 2016
Tweet

More Decks by Nathan Youngman

Other Decks in Technology

Transcript

  1. Porting to Rails 4 Sometimes the new code still works

    in old version of Rails.
 
 scope :sorted, order(“updated_at")
 
 scope :sorted, -> { order("updated_at") }
  2. # Gemfile
 
 if rails4?
 gem "rails", “4.0.5" # protected_attributes,

    etc.
 else
 gem "rails", "3.2.18"
 end Dual-boot Rails
  3. Incremental progress • Boot Server • Run Tests (Rails 3

    & 4) • Passing Tests • QA • Switch Default Rails
  4. whoops • Non-digest images in emails, use public/ • Blocks

    iframe embedding
 response.headers.except! ‘X-Frame-Options' • Endpoints
 protect_from_forgery exceptions (CSRF)
 xml_data = Hash.from_xml(request.body.read) • Threading bug in activerecord-session_store
  5. if rails_master?
 # gem "rails", :github => "rails/rails", :branch =>

    "4-2-stable"
 gem "rails", "5.0.0.beta1"
 else
 gem "rails", "4.2.5"
 end