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
86
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
97
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
96
Go Arrays & Slices
nathany
0
130
Go Types
nathany
2
130
Go Packages
nathany
2
540
Other Decks in Technology
See All in Technology
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
1
340
Web Intelligence and Visual Media Analytics
weblyzard
PRO
1
5.9k
Goの組織でバックエンドTypeScriptを採用してどうだったか / How was adopting backend TypeScript in a Golang company
kaminashi
12
8.8k
Aspire をカスタマイズしよう & Aspire 9.2
nenonaninu
0
250
QA/SDETの現在と、これからの挑戦
imtnd
0
150
30代からでも遅くない! 内製開発の世界に飛び込み、最前線で戦うLLMアプリ開発エンジニアになろう
minorun365
PRO
15
4.7k
Cursor AgentによるパーソナルAIアシスタント育成入門―業務のプロンプト化・MCPの活用
os1ma
15
6k
地味にいろいろあった! 2025春のAmazon Bedrockアップデートおさらい
minorun365
PRO
1
510
更新系と状態
uhyo
8
2.1k
持続可能なドキュメント運用のリアル: 1年間の成果とこれから
akitok_
1
240
SDカードフォレンジック
su3158
1
650
バクラクの認証基盤の成長と現在地 / bakuraku-authn-platform
convto
4
790
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
What's in a price? How to price your products and services
michaelherold
245
12k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Facilitating Awesome Meetings
lara
54
6.3k
Code Review Best Practice
trishagee
67
18k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
Into the Great Unknown - MozCon
thekraken
38
1.7k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
KATA
mclloyd
29
14k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
BBQ
matthewcrist
88
9.6k
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