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
Ginza Rails 1
Search
Akira Matsuda
September 20, 2018
Programming
6
1.2k
Ginza Rails 1
銀座Rails #1の招待講演のスライド #ginzarails
Akira Matsuda
September 20, 2018
Tweet
Share
More Decks by Akira Matsuda
See All by Akira Matsuda
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
13
4.7k
Hanamiを支える技術 2023 / Asakusa.rb Hanami 2023
a_matsuda
2
530
Rails 7.1をn倍速くした話
a_matsuda
11
12k
RubyKaigi 2022 After Talk
a_matsuda
0
400
Coming Soon…💎 / coming soon
a_matsuda
12
7.7k
Rails Performance Issues and Solutions
a_matsuda
9
35k
Extending Rails for Real World App Development
a_matsuda
9
7.4k
A RubyKaigi Talk
a_matsuda
8
2.3k
Oedo 07
a_matsuda
8
920
Other Decks in Programming
See All in Programming
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Realtime API 入門
riofujimon
0
150
Jakarta EE meets AI
ivargrimstad
0
560
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
920
Click-free releases & the making of a CLI app
oheyadam
2
120
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
Featured
See All Featured
The Invisible Side of Design
smashingmag
298
50k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Facilitating Awesome Meetings
lara
50
6.1k
How GitHub (no longer) Works
holman
310
140k
Practical Orchestrator
shlominoach
186
10k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Teambox: Starting and Learning
jrom
133
8.8k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Typedesign – Prime Four
hannesfritz
40
2.4k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Transcript
10.years of Rails Development @a_matsuda ۜ࠲Rails #1
self Twitter: @a_matsuda GitHub: amatsuda
ࣄ ྲྀ͠ͷٕज़ސۀΈ͍ͨͳ
झຯ
झຯ৯า͖
RubyϓϩάϥϚʔ / Railsϓϩά ϥϚʔ
ࠓͷ͓ͳ͠
ͬͺGinza SIX͔ͩΒ Rails 6ͷ
ͬͺGinza SIX͔ͩΒ Rails 6ͷ ͱࢥ͚ͬͨͲɺ ͋Μ·Γ͍ͨ͜͠ͱ͕ͳ͍ͷͰɺ
ʮRailsʹ͍ͭͯͷࣝΛަ͠ɺ ʑͷ։ൃʹཱ͍ͯͯ͜͏ʯ
Rails։ൃऀͷํʁ
10Ҏ্Rails։ൃऀ ͬͯΔํʁ
ͪΐͬͱੲ
10.years.ago
github.com͕Ͱ͖ͨ
Rails͡Ί·ͨ͠
Asakusa.rbୈ1ճmeetupͷ Ռ
ϦϙδτϦ4݄͔ΒGitHubʹஔ͔Ε͚ͯͨͲɺ ύονΔΓ͡Όͳͯ͘BTSʹషΔํࣜͩͬͨ https:/ / rails.lighthouseapp.com/ projects/8994/tickets/623
͋Ε͔Β10
739 Commits ฏۉ5Ͱ1ίϛοτ͙Β͍ͱ͍͏ ͜ͱ͕Θ͔Δ
ࢥ͍ग़ਂ͍ίϛοτͨͪ
always enable pp on the Rails console https:/ /github.com/rails/rails/ commit/d54c7781
always enable pp on the Rails console 2011ͷ࣌Ͱmame͞Μͷ Ruby 2.5ͷ৽ػೳΛઌऔΓ͍ͯ͠
ͨ͜ͱ͕Θ͔Δ
for ... in => .each https:/ /github.com/rails/rails/ commit/22ed6cb7
for ... in => .each Railsਓͨͪ each Λ͏ͷͩ ͱࢥΘΕ͕͚ͪͩͲɺ࣮DHH
for ... in Ͱॻ͍ͯͨʂ
treat fullwidth whitespace as a blank character https:/ /github.com/rails/rails/ commit/9c608603
treat fullwidth whitespace as a blank character String#blank? ͕શ֯εϖʔεͱ ͔ͦͷଞݟ͑ͳ͍จࣈΛશ෦ۭന
ѻ͍͢ΔΑ͏ʹ ͭ·ΓɺString#blank? ͨ͘͠ ͷΦϨΦϨ
Relation.where with no args can be chained with not, like,
and not_like https:/ /github.com/rails/rails/ commit/de75af7a
Relation.where with no args can be chained with not, like,
and not_like 4छྨͷsyntaxΛ࣮ͯ͠ఏҊ ࠓͷ where.not() ͷsyntaxJeremyҊ where.like ͱ͔ where.not_like ࣮͚ͨ͠ͲɺޙʹDHHʹϦόʔτ ͞Εͨ
tyop https:/ /github.com/rails/rails/ commit/c7f1bcd2
tabenai (typo) https:/ /github.com/rails/rails/ commit/407baa2b
tabenai (typo) ͍·ͩʹkamipo͞Μʹݴٴ͞Ε Δίϛοτ……
Space Oddity https:/ /github.com/rails/rails/ commit/d9bdb611
Space Oddity David Bowie͕͘ͳͬͨͷͰ͓ ͔͠ͳεϖʔεΛ୳ͯ͠ίϛοτ
Ruby and Rails ࣗͷओͳकඋൣғRubyͱ Railsͷؒͷ͋ͨΓ͔ͳɺͱࢥͬ ͯΔͷͰɺͪΐͬͱͦ͜Μͷ Λ͠·͢ɻ
kwargs & binding.local_variable_get Rails ͰͬͯΈΔ͜ͱͰ :if ͱ͔ :unless ͱ͍͏ϢʔεέʔεΛൃݟ Ruby
2.2͋ͨΓͰ binding.local_variable_get Λ ಋೖ
frozen_string_literal https:/ /bugs.ruby-lang.org/ issues/8976#change-53900
frozen_string_literal Railsͷ .freeze ࠈΛղফ͢Δ ͨΊʹRubyଆʹಋೖΛఏҊ
Refinements https:/ /github.com/rails/rails/ commit/571f0f32
Refinements Railsʹಋೖ͠(ͯRubiniusͰಈ͔ ͳ͘͠)ͨͷΦϨΦϨ
require_relative ͩ͞͞͞Μʹͦͦͷ͔͞Εͯ RailsͰͬͯΈͨΒόάͬͯͨ Ruby 2.4͙Β͍Ͱमਖ਼
protected Railsք۾ͰͨΒͱޡ༻͞Εଓ ͚͖ͯͨػೳ ΄΅શͯ private ͷؒҧ͍
When you say `protected` in Ruby, you might 99% be
meaning `private` https:/ /github.com/ amatsuda/rails/commit/ 6832343c
࣮ࡍͷίϛοτϥΠϒϥϦ͝ͱʹ rdocͷग़ྗ݁ՌΛ֬ೝ͠ͳ͕Β
Privatize unneededly protected methods in Active Record https:/ /github.com/rails/rails/ commit/5b14129d
ͳͲͳͲ
ηΩϡϦςΟؔ࿈ύον ͍͔ͭ͘ https:/ /github.com/rails/rails/ commit/87eab595 https:/ /github.com/rails/rails/ commit/dfa33fa3 ͱͦͷपล ͳͲͳͲ
௨Βͳ͔ͬͨఏҊͨͪ
Sexier migrations https:/ /github.com/rails/rails/ pull/1163
Sexier migrations migrationͷ t. ΛΔͭ t. ཁΒͳ͍ͱࢥ͏Μ͚ͩͲͳ͊
automatic client side validation with HTML 5 "required" attribute https:/
/github.com/rails/rails/ pull/3590
automatic client side validation with HTML 5 "required" attribute Ϟσϧʹॻ͍ͨvalidationΛΫϥ
ΠΞϯταΠυʹө 2011ʹఏҊ ࣌ΛઌऔΓ͗ͯͯ͢͠ݟૹΒΕ ͨ
Action Args ΞΫγϣϯϝιουʹҾΛ ΔΓग़ͯ͠ͳͯ͘ɺνϟοτͰ ఏҊͨ͠ؾ͕͢Δ DHHʹେےͰؾʹೖͬͯΒ͑ͨ ͷͷɺࡉ͔͍෦ͷ༷͕ંΓ߹ Θͣ٫Լ
օ͞Μ͔Βͷ :+1:ܴ͠·͢
͜Μͳײ͡ͰɺRailsຊମʹಥͬࠐΉҎ֎ʹɺ ϓϥάΠϯͱ࣮ͯ͢͠Δ͜ͱ͋Γ·͢
ϓϥΪϯ։ൃ
i18n_generators
i18n_generators I18nͷϦιʔεΛਓ͕ؒॻ͔ͳ͘ ͯΑ͘ͳΔ࠷ߴʹΜΓͳͭ 10લʹ࡞͚ͬͨͭͩͲɺ Rails 5.2Ͱະͩʹ͑Δ
kaminari
kaminari ϖʔδωʔγϣϯ͢Δͭ Rails 3Ͱಈ͍ͯΔͷ͕ͳ͔ͬͨ ͷͰ࡞ͬͨ M, V, Cͷ3ͭͷϨΠϠʔʹ ·͕ͨΔػೳ
Rails 3ͷ৽ػೳɺRails Engine ͬͯͭͰ࡞ͬͯΈͨͯ͘࡞ͬͨ
ͨͿΜੈքͰ2൪͙Β͍ʹݹ͍ ࣮༻ϨϕϧͷEngine
action_args
action_args DHHʹఏҊ͕௨Βͳ͔͚ͬͨͲɺgemͰ ͝ར༻͍͚ͨͩ·͢ Asakusa.rb໊ٛͰϝϯς શRailsϓϥάΠϯͷதͰҰ൪͖ ͱ͍͏͔ɺ͜Ε͕ೖͬͯͳ͍ͱRailsΞϓ Ϧॻ͚ͳ͍
active_decorator
active_decorator ϔϧύʔॻ͖ͨ͘ͳ͍(ϔϧύʔࢮΜͰ ΄͍͠) ઌߦϓϩμΫτ͕ͼͬ͘Γ͢Δ͙Β͍ ϔϘ͔ͬͨͷͰ༷࣮1000ഒ͙ Β͍ϚγͳͭΛࣗ࡞ OpinionatedͳσβΠϯ
OpinionatedͳσβΠϯ ࠷ۙͷόʔδϣϯͰ݁ہંΕͨͷ Ͱɺ෦తʹഊͨ͠ͱݴ͑Δ
html5_validations ຊମͷఏҊ௨Βͳ͔͚ͬͨͲ gemͰ͝ར༻͍͚ͨͩ·͢ ϓϥάΠϯ࡞Γͷڭࡐʹͪΐ͏Ͳ ͍͍͔
stateful_enum
stateful_enum AR֦ுܥ ΊͪΌΊͪΌ࣮༻త σβΠϯ࣮γϯϓϧͰ៉ྷ (ͩͬͨ)
erd
erd ERਤΛϒϥβ্Ͱΰχϣΰ χϣ͢ΔEngine ඍົʹະ
Rails Engine͍͍ΑͶ
hocus_pocus
hocus_pocus Rails Engineͷݶքʹઓͨ͠ ҙཉ࡞ υΩϡϝϯτ͕օແͳͷͰͨͿΜ ͑ͳ͍ web_consoleΛΠϯεύΠΞͨ͠ͱ ͍͏ྺ࢙తҙٛ
ͦΖͦΖ·ͱΊ
ʮRailsʹ͍ͭͯͷࣝΛަ͠ɺ ʑͷ։ൃʹཱ͍ͯͯ͜͏ʯ
ͱ͍͏͜ͱͰɺʑͷ։ൃͷ Λ͠·ͨ͠
Railsϓϩάϥϛϯάͨͷ͍͠
RailsϓϩάϥϛϯάͰΛ ੜͦ͏ʂ
ଓ͖࠙ձͰʂ