Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Upgrading Rails Redux
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nathan Youngman
January 19, 2016
Technology
110
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Upgrading Rails Redux
A refresh of my talk on upgrading Rails.
Nathan Youngman
January 19, 2016
More Decks by Nathan Youngman
See All by Nathan Youngman
The Healthy Programmer
nathany
2
120
Go and Node.js: a comparison
nathany
1
260
Diet Hacks
nathany
2
410
Go 1.6 and HTTP/2
nathany
3
170
GopherCon recap
nathany
0
210
Go Functions
nathany
0
120
Go Arrays & Slices
nathany
0
180
Go Types
nathany
2
150
Go Packages
nathany
2
580
Other Decks in Technology
See All in Technology
PdMをやめて、 "プロダクトビルダー"という 働き方に変えました / PdM to Product Builder
shikichee
1
250
暗号化?某ファイルストレージはどうなるの!? 3rd Partyとうまく付き合う秘密度ラベル設計
kasada
0
220
Claude Teamプランの コスト最適化を考える
rfdnxbro
1
820
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
5k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.3k
GopherCon @シアトル に行ってきました
logica0419
0
440
Dylib Hijacking on macOS: Dead or Alive?
patrickwardle
0
140
AI時代のデータ基盤を考える問い
pacocat
0
750
信頼性はSREだけのものじゃない
hkawaras
0
330
EUDIWの枠組みを出発点に民間エコシステムの在り方を考える(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
360
Distributed Transactions Under Fire: Building a Zero-Oversell Flash Sale Platform with Amazon Aurora DSQL
yama3133
1
110
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
15k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
980
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Raft: Consensus for Rubyists
vanstee
141
7.7k
Building Adaptive Systems
keathley
44
3.2k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
490
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
The Pragmatic Product Professional
lauravandoore
37
7.4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
510
Transcript
Upgrading Rails Redux
Who has a Rails app in production?
Rails 1.x
Rails 2.x
Rails 3.x
None
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") }
Porting to Rails 4 Otherwise branch?
Dual-boot Rails # Gemfile def rails4? ENV["RAILS4"] == '1' end
RAILS4=1 rails s
# Gemfile if rails4? gem "rails", “4.0.5" # protected_attributes,
etc. else gem "rails", "3.2.18" end Dual-boot Rails
# config/environments/test.rb ActiveSupport::Deprecation.silenced = true if rails4? Dual-boot
Rails
RailsDiff
Incremental progress • Boot Server • Run Tests (Rails 3
& 4) • Passing Tests • QA • Switch Default Rails
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
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
Resources • https://github.com/discourse/discourse/ blob/master/Gemfile • http://railsdiff.org/ • https://speakerdeck.com/nathany/ upgrading-rails-redux
Gopher Gala edmontongo.org
https://yng.mn/39youngman