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 6.0の気になった新機能 #shuuumai
Search
Hiroaki Ninomiya
October 09, 2019
Technology
1
740
Rails 6.0の気になった新機能 #shuuumai
『【シューマイ】Tech Lead Engineerから最新技術を学べ!Rails編×station』
https://shuuu-mai.connpass.com/event/146313/
Hiroaki Ninomiya
October 09, 2019
Tweet
Share
More Decks by Hiroaki Ninomiya
See All by Hiroaki Ninomiya
スタートアップとは何か?アジャイル文脈で何が大変なのか? #shibuyagile
treby
0
120
渋谷アジャイルコミュニティへの想い #shibuyagile
treby
0
1k
久々にコードを書いてOmniauthでハマった話
treby
0
1k
IM@Study活動紹介
treby
1
570
全ての雑用を、生まれる前に消し去りたい
treby
0
530
Webエンジニアからデータエンジニアへ転向している話 #pronama
treby
0
400
Shinjuku.rbの移り変わりについて、あるいは大規模カンファレンスの知見を募集したい話 #tqrk13
treby
1
170
EMの悩みにフォーカスする #em_izakaya
treby
0
560
この先生きのこるためのエンジニアキャリア戦略パターン #em_meetup
treby
5
2.6k
Other Decks in Technology
See All in Technology
In Praise of "Normal" Engineers (LDX3)
charity
2
1.1k
VISITS_AIIoTビジネス共創ラボ登壇資料.pdf
iotcomjpadmin
0
140
新卒3年目の後悔〜機械学習モデルジョブの運用を頑張った話〜
kameitomohiro
0
360
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
190
OTFSG勉強会 / Introduction to the History of Delta Lake + Iceberg
databricksjapan
0
120
白金鉱業Meetup_Vol.19_PoCはデモで語れ!顧客の本音とインサイトを引き出すソリューション構築
brainpadpr
2
450
AWS CDK 実践的アプローチ N選 / aws-cdk-practical-approaches
gotok365
4
310
DB 醬,嗨!哪泥嘎斯基?
line_developers_tw
PRO
0
1.1k
Workflows から Agents へ ~ 生成 AI アプリの成長過程とアプローチ~
belongadmin
3
170
Amazon Q Developer for GitHubとAmplify Hosting でサクッとデジタル名刺を作ってみた
kmiya84377
0
3.5k
(非公式) AWS Summit Japan と 海浜幕張 の歩き方 2025年版
coosuke
PRO
1
320
AWS アーキテクチャ作図入門/aws-architecture-diagram-101
ma2shita
28
9.3k
Featured
See All Featured
Done Done
chrislema
184
16k
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Embracing the Ebb and Flow
colly
86
4.7k
Gamification - CAS2011
davidbonilla
81
5.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
What's in a price? How to price your products and services
michaelherold
245
12k
The World Runs on Bad Software
bkeepers
PRO
68
11k
It's Worth the Effort
3n
184
28k
Agile that works and the tools we love
rasmusluckow
329
21k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
790
Building an army of robots
kneath
306
45k
Transcript
Rails 6.0 ͷؾʹͳͬͨ৽ػೳ 2019/10/09 γϡʔϚΠRailsฤ Hiroaki Ninomiya a.k.a @treby006
ࣗݾհ • treby(ͱΕͼʔ) a.k.a Hiroaki Ninomiya • Reproגࣜձࣾ BizDevࣄۀ෦ •
Solution Architect • BtoB SaaSاۀ • ৬ۀΤϯδχΞͷΩϟϦΞΛߟ͑Δɺʮ͖ͷ͜ΔΤϑΤϜʯ͍ͬͯ·͢ • Vue Fes Japan 2019 ίΞελοϑ(෩)
ϙουΩϟετ
Vue Fes Japan 2019(10/12)
Agenda • ձࣾհ • ࣮։ൃऀͱͯ͠Rails6ͷ͏ͪؾʹͳͬͨػೳΛ͝հʂ
Reproגࣜձࣾ • 2014ઃཱͷελʔτΞοϓاۀ • https://repro.io/ • BtoB SaaS • ࣗࣾϓϩμΫτRepro
SDKΛ։ൃ • ϞόΠϧΞϓϦͷੳɾϚʔέςΟϯά༻్ • ಛఆηάϝϯτʹ؆୯ʹϓογϡ௨͕ଧͯΔ • ݱࡏɺઈࢍٸத
Solution Architect • Bizdev -> ʮࣄۀΛՃͤ͞Δʯࣄ • https://note.mu/saas_bizdev/n/ncd38d86262f4 • BizDevͷSolution
Architect • ཁ݅ఆٛΛ͢ΔΑΓߋʹલ͔ΒೖΔ • ސ٬ͷཁٻཧղɺ࿈ܞީิπʔϧͱͷίϛϡχέʔγϣϯ • ࿈ܞͷ͋Δ͖ʹ͍ͭͯɺϩʔυϚοϓΛҾ͖ɺ࣮ߦ͢Δ • هࣄॻ͍ͨͷͰΑ͚Ε: https://tech.repro.io/entry/2019/08/21/174705
ReproͷRails • Reproൃදஈ֊ͰRails 5.2 • Rails 6.0ʹ͢ΔPRཱͬͯΔͷͰ͏·ͳ্͕͘ΔͩΖ͏
Rails 6.0ͷ৽ػೳ https://railsguides.jp/60release_notes.html
ಛʹݸਓతʹؾʹͳͬͨػೳ • Railties • Action Pack • Active Support
rails routesग़ྗΛ֦ுϑΥʔϚοτ ͰදࣔͰ͖Δػೳ • rails routes --expanded ͱॻ͘ͱීஈͷςʔϒϧϑΥʔϚοτͰͳ ͘ৄࡉͳද͕ࣔͳ͞ΕΔ •
େنΞϓϦέʔγϣϯͷRoutesͷߜΓࠐΈ͕Ͱ͖Δͷͳ ͍ͷ͔ • ࣮ -g Φϓγϣϯ͕͋ͬͨɺΒͳ͔ͬͨ • https://github.com/rails/rails/pull/23225 ɺ2016 Rails 5 ͔Β
ͯ͢ͷenumʹ͍ͭͯωΨςΟϒ είʔϓΛՃ • https://github.com/rails/rails/pull/35381 • λΠτϧ͚ͩͰԿͷ͜ͱ͔͔Βͳ͍Ͱ͕͢ class Post < ActiveRecord::Base
enum status: [:drafted, :active, :trashed] end • Post.not_drafted Έ͍ͨͳࢦఆ͕Ͱ͖ΔΑ͏ʹͳΔ • ݸผʹscope͍ͬͯͨͷ͕ෆཁʹͳΔ • ͦͦenum͕͖͔Ͳ͏͔ͱ͍͏ͷ͋Γ·͕͢ɺɺɺ
ActiveRecord.enumͰੜ͞Εͨε ίʔϓΛແޮʹ͢ΔػೳΛՃ • https://github.com/rails/rails/pull/34605 • ಠࣗͰείʔϓ͍ͬͯͨ߹ͱ͔͑ͦ͏ • ͦͦenum͕͖͔(ry
before? ϝιουͱ after? ϝιουΛҎԼʹՃ Date ɺDateTime ɺTime ɺTimeWithZone • https://github.com/rails/rails/pull/32185
• ࣌ؒൺֱܥ • :< , :> ͷൺֱͳͷ͚ͩͲ
ҰׅINSERTΛߦ͏ insert_all / insert_all! / upsert_all ϝιουΛ Ճ • https://github.com/rails/rails/pull/35077
• ActiveRecord#insert_all • ΄͔ͬͨͭ͠
ActiveRecord::Relation#annotate ΛՃ: ActiveRecord::RelationΫΤ ϦʹSQLίϝϯτΛՃ͢Δ • annotate_models ͱผ • ΞϓϦέʔγϣϯίʔυͷҙͷॴͰίϝϯτΛૠೖ͢Δ͜ͱ ͕Ͱ͖Δ
• க͠ํͳ͘ൃߦ͍ͯ͠ΔΫΤϦͱ͔ɺେنͳΞϓϦέʔγϣϯ ͰࠐΉΑ͏ʹ͓ͯ͘͠ͱௐ͕͔ࠪͲΓͦ͏
ຯʹخ͍͠ / ͑ͦ͏ͳ͋Ε͜Ε • Truncateͷαϙʔτ • https://github.com/rails/rails/pull/34779 • Ruby 2.6Ͱಋೖ͞ΕͨΤϯυϨεrangeΛ#whereͰαϙʔτ
• https://github.com/rails/rails/pull/34779 • #inspectͷݸਓใσʔλΛϑΟϧλͰআ֎͢ΔػೳΛՃ • https://github.com/rails/rails/pull/34208
·ͱΊ • Rails6.0ؾʹͳͬͨػೳͱ࣮ࡍͷmigrateͷࣄྫΛհ • Railsී௨ʹॻ͚ΔΑ͏ʹͳͬͨɺͱࢥͬͯͬ͘͡Γ ChangelogPRݟͯΈΔͱൃݟ͕͋ͬͯ໘ന͍ • Rails 6.0ʹ͔ͯ͠Β͍͍ͨػೳ͋Γ·͔ͨ͠ʁ •
ActiveRecord , ActiveSupport पΓ͕๛࡞Ͱָͦ͠͏