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のための負債の減らし方
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
alpaca-tc
September 27, 2016
450
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Railsのための負債の減らし方
alpaca-tc
September 27, 2016
More Decks by alpaca-tc
See All by alpaca-tc
新米DPEが取り組む 開発者体験の向上
alpacatc
0
61
Refinementsのメソッド定義を4000倍速くした話
alpacatc
5
1.8k
~Rubyと暮らし、OSSに貢献し、登壇する~ 半年間続けた「OSSやっていきの集い」の成果と学び
alpacatc
0
150
TracePointを活用してモデル名変更の負債解消をした話
alpacatc
2
1.8k
Railsのモデル名をすべて変更した話
alpacatc
0
480
新規サービス立ち上げを経て気づいたマネーフォワードの文化
alpacatc
0
1.7k
Attributes API 実践
alpacatc
4
2k
Mastodonを3倍早くしたい話
alpacatc
0
3.1k
AdminScriptで管理画面をスッキリさせる
alpacatc
3
720
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
300
GitHub's CSS Performance
jonrohan
1033
470k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
220
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
440
エンジニアに許された特別な時間の終わり
watany
107
250k
Designing Powerful Visuals for Engaging Learning
tmiket
1
430
A Soul's Torment
seathinner
6
3k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Optimizing for Happiness
mojombo
378
71k
Transcript
RailsͷͨΊͷ ෛ࠴ͷݮΒ͠ํ @alpaca-tc
ࣗݾհ
@alpaca-tc @alpaca_tc ❤ Vim, Ruby, ͍ͬ͘Μ@pixiv
ͷͮ͘Γ͕ͬͱָ͘͠ͳΔΞΠςϜ࡞αʔϏε pixivFACTORY ը૾1ຕ͔Β 40छͷ άοζɾಉਓࢽ ॳظඅ༻0 ΦϯσϚϯυൢച 2015.02.05-
ͷͮ͘Γ͕ͬͱָ͘͠ͳΔΞΠςϜ࡞αʔϏε pixivFACTORY Rails 2015.02.05- JavaScript Go Blender Controllers 93 ϑΝΠϧ
Models 304 ϑΝΠϧ table 70+
ࠓே
None
None
ෛ࠴͕େ͖͍΄Ͳฦࡁ͕େม
ෛ࠴͕େ͖͍΄Ͳฦࡁ͕େม ෛ࠴খ·Ίʹฦ͢ํ͕ྑ͍
Θ͔Δ
None
RailsͷΞοϓάϨʔυ
খ·Ίʹෛ࠴ΛݮΒͯ͠ ָʹRailsΞοϓσʔτ
ෛ࠴ΛݮΒ͢3ͭͷίπ
1. ίʔυΛॻ͔ͳ͍
ίʔυ͕গͳ͍΄Ͳ ΞοϓσʔτָʹͳΔ
YAGNI You Ain’t Gonna Need It
ػೳඞཁʹͳΔ·ͰՃ͠ͳ͍ ʮίʔυΛૉૣ࣮͘͢ΔͨΊ ͷ࠷ྑ͍ํ๏ɺ͋·Γίʔ υΛॻ͔ͳ͍͜ͱʯ
ෆཁʹͳͬͨίʔυ ΨϯΨϯফ͍ͯ͘͠
Rails Way CoC / DRY
”Կ͔Λͳ͢͏͑Ͱ࠷ળͷํ๏ͱ ͍͏ͷ͕1͚ͭͩ͋Δ” कΕίʔυখ͘͞ͳΔ
2. Ξοϓσʔτখ·Ίʹ
Ͱ͢
Rails 5 dateΧϥϜʹɺҰ෦ۭനͷΛpost͢Δ Ͳ͏ͳΔͰ͠ΐ͏ʁ record.update(params.permit(:date))
record.update(params.permit(:date)) NoMethodError: undefined method `in_time_zone' for 0:Fixnum
ීஈ͔Βɺߋ৽Λࡉ͔͘backport͢Δ config/initializers/rails51_backport.rb backport͢Δ 5.0-stableόά͍ͬͯΔɻ(#25834, #25146, #25364…etc) ৽ػೳ͍ΕΔͱόʔδϣϯΞοϓָ͕ (#25991ͳͲ) ʮThis Week
in RailsʯͷRSSʹྲྀΕͨมߋΛ খ·ΊʹೖΕΔͱྑ͍
3. ةͳ͍ίʔυΛݕ
if Rails.gem_version >= Gem::Version.new('5.0.0') ActiveSupport::Deprecation.warn('廃止予定') raise('要チェック') ίʔυʹຒΊࠐΉ
if Rails.gem_version >= Gem::Version.new('5.0.0') ActiveSupport::Deprecation.warn('廃止予定') raise('要チェック') ίʔυʹຒΊࠐΉ ɾRailsΛϋοΫ͍ͯ͠ΔՕॴ ɾෛ࠴ͷՕॴ ɾ࣍ظόʔδϣϯͰಈ͔ͳ͘ͳΔՕॴ
ෛ࠴ΛೝࣝͰ͖Δ RailsͷόʔδϣϯΛ্͛Δ࣌ʹ ࣮֬ʹฦࡁ͞ΕΔ
͓ΘΓ
pixivFACTORY 1+ͰऴΘΓ·ͨ͠
ීஈ͔Βෛ࠴ΛݮΒͯ͠ ։ൃʹूத͠·͠ΐ͏
ΤϯδχΞืूதʂ