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
Rails 4.2→5.2アップデート
Search
horikawa
May 29, 2019
Programming
0
380
Rails 4.2→5.2アップデート
Rails 4.2を5.2にアップデートした時の流れをまとめました。
horikawa
May 29, 2019
Tweet
Share
More Decks by horikawa
See All by horikawa
Caching associations in rails
casix
1
320
Create Action Mailbox Sample Application
casix
1
340
Rails 6.0 Action Mailboxについて
casix
0
370
Other Decks in Programming
See All in Programming
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
1
110
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.3k
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
CSC509 Lecture 11
javiergs
PRO
0
180
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
イベント駆動で成長して委員会
happymana
1
340
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
受け取る人から提供する人になるということ
little_rubyist
0
250
Ethereum_.pdf
nekomatu
0
470
Featured
See All Featured
Ruby is Unlike a Banana
tanoku
97
11k
Writing Fast Ruby
sferik
627
61k
Making Projects Easy
brettharned
115
5.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Designing the Hi-DPI Web
ddemaree
280
34k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Side Projects
sachag
452
42k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Transcript
Rails 4.2→5.2ʹ Ξοϓσʔτͨ͠ ງʢ@CASIXx1ʣגࣜձࣾπΫϧό
• ීஈʮcowcamoʯͱ͍͏ΞϓϦΛ։ൃͯ͠ ·͢ • αʔόαΠυɺRailsΛͬͯ·͢
࣮ͦΜͳʮcowcamoʯ ϲ݄લ·Ͱ...
Rails 4.2!!!
Ruby 2.3!!!
্͛ͳ͖Όʢ໋ײʣ
gemͷΞοϓσʔτ ͔ͨ͜͠͠ͱͳ͍Μ͕ͩ...
ʙ४උฤʙ
·ͣɺRubyΛ2.5ʹ্͛Α͏ ʢ࣌ɺ201811݄ࠒʣ
্͛ͨ Τϥʔग़ͳ͔ͬͨ
্͛Δ࣌ʹɺ ͍ͭͰʹRailsΞοϓσʔτ Ͱ͑ΔͷΛ༻ҙͨ͠
ಈ࡞֬ೝ߲ॻΛ࡞͓͍ͬͯͨ • ಈ࡞֬ೝͷγφϦΦΛ࡞Γ • ސ٬ͷಈ࡞Λ࠷ݶ୲อ͍ͨ͠ϥΠϯ • ۀ্ΫϦςΟΧϧͳՕॴ୲อ͍ͨ͠ͳ ͲΛఆٛ • ͦΕΛݩʹ߲ॻΛ࡞
ͱ͍͑ɺ ͜Ε͚ͩͰ৺ͱͳ͍...
ϦάϨογϣϯςετ ڧԽͤͶ
ϢχοτςετͷΧόϨοδΛ 80% ͙Β͍·Ͱ্͛ͨ
Issueࣄલ༻ҙ͠ͳ͖Ό
͝ஸೡʹΞοϓάϨʔυΨΠυ͕ ༻ҙ͞ΕͯΔͧʂ
ྔগͳw
None
...ϦϦʔεϊʔτΛݟΑ͏
Issue༻ҙ • 5.0, 5.1, 5.2 ͷϦϦʔεϊʔτͱʮcowcamoʯͷ ίʔυΛൺֱͯ͠ɺରԠ͖͢issueΛͬͨ • ࠓճɺେྔʹissue͕ग़ͦ͏ͳͷͰɺ֤όʔδϣϯ ͱ༏ઌͰϥϕϧΛ࡞͓͍ͬͯͨʢ͜Εྑ͔ͬ
ͨͰ͢ʂʣ • Rails5.0:MUST, Rails5.0:SHOULDΈ͍ͨͳ...
Αʔ͠ɺ্͛Δ͔ʔ
Rails 5.0
खॱ • Rails 5.0ʹ্͛Δ 1. ϦάϨογϣϯςετͰΤϥʔग़Δ 2. Issueʹ͢Δ 3. मਖ਼͢Δͷϧʔϓ
• ࣄલ༻ҙͨ͠IssueফԽ͍ͯ͘͠
͜͜Ͱ͔ͬͨ͜ͱ...
ϦϦʔεϊʔτʹࡌͬͯͳ͍ มߋͰͨ͘͞ΜΤϥʔ͕ग़ͨ
ͬͱফԽͨ͠ʂ ͱࢥ͍͖
લͰൃੜ
Rails 4.2Ͱ࡞ͨ͠ δϣϒΛ͑ͳ͍
σγϦΞϥΠζͰ͖ͳ͍ • Rails 4.2ͷ࣌ʹδϣϒΛ ϚʔγϟϧγϦΞϥΠζ͍ͯͨ͠ • Rails 4.2ʹ͋ͬͯɺ5.0ʹͳ͍ΫϥεΛؚΊͯγϦ ΞϥΠζ͍ͯͨ͠ͷͰɺσγϦΞϥΠζ͢Δࡍʹɺ ఆΤϥʔ͕ൃੜ
• ActiveRecord::ConnectionAdapters::AbstractMysql Adapter::MysqlDateTimeͱ͔...
ղܾࡦ • δϣϒ • Rails 4.2ʹ͋ͬͯɺRails 5.0ʹͳ͍Ϋϥε ɺμϛʔͰఆٛͨ͠ • 4.2ͷδϣϒΛফԽͨ͠Βɺআ
Rails 4.2͔Βෳ
͍ͭʹϦϦʔεʂʂ
ޭʂ ͔͠ϊʔΤϥʔͩͱ...!?
ଓ͍ͯ5.1ʂ
Rails 5.1
5.1Ͱগۤ͠࿑ͨ͠Օॴ
uniq→distinctมߋ • ActiveRecordͱ ActiveRecord::ActiveRecord_Relationͷ uniqϝιου͕distinctϝιουʹมߋ͞Εͨ
uniq→distinctมߋ • ActiveRecord::ActiveRecord_Relation Array ͷuniqϝιουΛҕৡ͍ͯ͠ΔͷͰɺ uniq→distinctʹ͠Εͯɺ NoMethodError͕ग़ͳ͍... • ·ͨɺArrayͰҾ͖ଓ͖ɺuniqΛ͏ͷͰɺ શͯdistinctʹ͍͍ͤΘ͚Ͱͳ͍
Rails 5.2
image_tagͷมߋ͕...
image_tag • CarrierWaveͷUploaderͬͯ͋Δ͡Όͳ͍Ͱ ͔͢
image_tag • ࠓ·Ͱɺ image_tag(@image_uploader_object)Έ͍ͨ ʹ ΠϝʔδΞοϓϩʔυΦϒδΣΫτΛೖΕͯ ͳΜ͔Μͯ͘͠Ε͕ͨɺͯ͘͠Εͳ͘ͳͬ ͨ
image_tag • ۩ମతʹɺ • Can't resolve image into URL: undefined
method `to_model' for #<MyUploader:xxxxxxxxxx> Did you mean? to_xml • ͳΔΤϥʔ͕ग़·͢
image_tagղܾࡦ • ୈҰҾʹɺURLͷจࣈྻΛͤͱͷ͜ ͱͩͬͨͷͰ • image_tag(@image_uploader_object) ↓ image_tag(@image_uploader_object.url) • ʹॻ͖͑ͨ
ͪͳΈʹ • mount_uploader :url, MyUploaderΈ͍ͨʹॻ ͍͍ͯΔͱ... • image_tag(@profile_image.url.url) Έ͍ͨʹ ͳΓ·͢
ŘşũūŘ
·ͱΊ
ྑ͔ͬͨͱ͜Ζ • ϢχοτςετͷΧόϨοδΛ80%ॻ͍ͨ • ઈରʹΤϥʔग़ͨ͘͠ͳ͍Օॴɺ ಈ࡞֬ೝ߲ॻΛ࡞ͯ͠ɺखಈͰͷ֬ೝΛͨ͜͠ͱ • ݹ͍ڥ(4.2)→৽͍͠ڥ(5.0ͳͲ)ͷ֬ೝΛͨ͜͠ ͱ •
ηογϣϯɾδϣϒͷෆ۩߹Λݟ͚ͭΒΕΔ
ఆ֎ͩͬͨՕॴ • ϦϦʔεϊʔτΛ֬ೝͨ͠Βɺेͩͱࢥ͍ ࠐΜͰ͍͕ͨɺ ϦϦʔεϊʔτʹͳ͍มߋͳͲΤϥʔ͕ग़ ͍ͯͨ(શମͷ30~40%͙Β͍) • ϦάϨογϣϯςετΛॻ͍ͯɺ্͛ͯɺΤ ϥʔΛ௵͍ͯ͘͠ํ͕ϝΠϯʹͳΓͦ͏
None
RailsΞοϓσʔτ ϊʔΤϥʔͰͨ͠ ☀