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
720
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
99
渋谷アジャイルコミュニティへの想い #shibuyagile
treby
0
990
久々にコードを書いてOmniauthでハマった話
treby
0
1k
IM@Study活動紹介
treby
1
560
全ての雑用を、生まれる前に消し去りたい
treby
0
510
Webエンジニアからデータエンジニアへ転向している話 #pronama
treby
0
380
Shinjuku.rbの移り変わりについて、あるいは大規模カンファレンスの知見を募集したい話 #tqrk13
treby
1
160
EMの悩みにフォーカスする #em_izakaya
treby
0
550
この先生きのこるためのエンジニアキャリア戦略パターン #em_meetup
treby
5
2.5k
Other Decks in Technology
See All in Technology
スプリントゴールで価値を駆動しよう
takufujii
3
1.6k
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.6k
Modular RAG Architectures with Java and Spring AI
thomasvitale
1
280
Data Hubグループ 紹介資料
sansan33
PRO
0
1.7k
データ戦略部門 紹介資料
sansan33
PRO
1
3.1k
主要ライブラリの実例に学ぶ、TypeScriptで実現する型安全な座標定義
tiroljpn
1
220
Eight Engineering Unit 紹介資料
sansan33
PRO
0
3k
KMP導⼊において、マネジャーとして考えた事
sansantech
PRO
1
170
TerraformとGitHub Actionsで手軽に実装するECSのCI/CD
k___tkg
0
230
AI駆動時代の新規事業の作り方
ryohysk
2
140
マップを速く表示するために
tsuboyan5
0
170
金融システムをモダナイズするためのAmazon Elastic Kubernetes Service(EKS)ノウハウ大全
daitak
0
100
Featured
See All Featured
Fireside Chat
paigeccino
37
3.5k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
Building Applications with DynamoDB
mza
95
6.4k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
For a Future-Friendly Web
brad_frost
178
9.7k
How to train your dragon (web standard)
notwaldorf
92
6k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Producing Creativity
orderedlist
PRO
345
40k
Site-Speed That Sticks
csswizardry
6
570
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 पΓ͕๛࡞Ͱָͦ͠͏