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
alpaca-tc
September 27, 2016
0
390
Railsのための負債の減らし方
alpaca-tc
September 27, 2016
Tweet
Share
More Decks by alpaca-tc
See All by alpaca-tc
TracePointを活用してモデル名変更の負債解消をした話
alpacatc
2
1.4k
Railsのモデル名をすべて変更した話
alpacatc
0
380
新規サービス立ち上げを経て気づいたマネーフォワードの文化
alpacatc
0
1.5k
Attributes API 実践
alpacatc
4
1.8k
Mastodonを3倍早くしたい話
alpacatc
0
2.8k
AdminScriptで管理画面をスッキリさせる
alpacatc
3
610
[pixiv summer boot camp] pixivFACTORY
alpacatc
0
3.5k
Featured
See All Featured
Facilitating Awesome Meetings
lara
50
6.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Six Lessons from altMBA
skipperchong
27
3.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Building Your Own Lightsaber
phodgson
103
6.1k
It's Worth the Effort
3n
183
27k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Building Adaptive Systems
keathley
38
2.3k
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+ͰऴΘΓ·ͨ͠
ීஈ͔Βෛ࠴ΛݮΒͯ͠ ։ൃʹूத͠·͠ΐ͏
ΤϯδχΞืूதʂ