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
Nathan Youngman
January 19, 2016
Technology
1
85
Upgrading Rails Redux
A refresh of my talk on upgrading Rails.
Nathan Youngman
January 19, 2016
Tweet
Share
More Decks by Nathan Youngman
See All by Nathan Youngman
The Healthy Programmer
nathany
2
96
Go and Node.js: a comparison
nathany
1
180
Diet Hacks
nathany
2
350
Go 1.6 and HTTP/2
nathany
3
120
GopherCon recap
nathany
0
160
Go Functions
nathany
0
94
Go Arrays & Slices
nathany
0
120
Go Types
nathany
2
120
Go Packages
nathany
2
530
Other Decks in Technology
See All in Technology
DevinはクラウドエンジニアAIになれるのか!? 実践的なガードレール設計/devin-can-become-a-cloud-engineer-ai-practical-guardrail-design
tomoki10
2
500
セマンティックレイヤー入門
ikkimiyazaki
7
2.1k
AIは脅威でなくチャンス。 AIと共に進化するエンジニアの成長戦略 / geeksai-2025-spring
carta_engineering
0
460
生成AIで生産性向上
tomuro
0
240
移行できそうでやりきれなかった 10年超えのシステムを葬るための戦略 / phper-kaigi-2025-ryu
carta_engineering
0
660
Why Go?
xpmatteo
0
120
移行できそうでやりきれなかった 10年超えのシステムを葬るための戦略
ryu955
2
170
Explainable Software Engineering in the Public Sector
avandeursen
0
180
SLI/SLO・ラプソディあるいは組織への適用の旅
nwiizo
4
890
単一の深層学習モデルによる不確実性の定量化の紹介 ~その予測結果正しいですか?~
ftakahashi
PRO
3
490
空が堕ち、大地が割れ、海が涸れた日~もしも愛用しているフレームワークが開発停止したら?~ #phperkaigi 2025
77web
2
920
OCI Oracle Database Services新機能アップデート(2024/12-2025/02)
oracle4engineer
PRO
2
180
Featured
See All Featured
Building an army of robots
kneath
304
45k
Building Adaptive Systems
keathley
40
2.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Optimizing for Happiness
mojombo
377
70k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Speed Design
sergeychernyshev
28
850
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
28
2k
Visualization
eitanlees
146
15k
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