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
【2018/09/18 Otemachi.rb#9】君(退会したユーザ)の名は。
Search
Shu OGAWARA
September 18, 2018
Technology
0
510
【2018/09/18 Otemachi.rb#9】君(退会したユーザ)の名は。
2018/09/18のOtemachi.rb#9での発表資料です。久しぶりのRailsネタです。
Shu OGAWARA
September 18, 2018
Tweet
Share
More Decks by Shu OGAWARA
See All by Shu OGAWARA
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
1
280
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
5
1.9k
エンジニアリングマネージャーはどう学んでいくのか #devsumi / How Do Engineering Managers Continue to Learn and Grow?
expajp
8
4.6k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
460
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
430
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.2k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
39k
【2019/07/06 TamaRuby会議01】brainf*ck処理系で理解するパターンマッチングをつかった疎結合な実装
expajp
2
2.7k
その正規表現、異議あり! 〜 ReDoSについて
expajp
2
5.7k
Other Decks in Technology
See All in Technology
AI駆動で進化する開発プロセス ~クラスメソッドでの実践と成功事例~ / aidd-in-classmethod
tomoki10
1
800
30代からでも遅くない! 内製開発の世界に飛び込み、最前線で戦うLLMアプリ開発エンジニアになろう
minorun365
PRO
16
5k
Linuxのパッケージ管理とアップデート基礎知識
go_nishimoto
1
700
CodeRabbitと過ごした1ヶ月 ─ AIコードレビュー導入で実感したチーム開発の進化
mitohato14
1
230
AI 코딩 에이전트 더 똑똑하게 쓰기
nacyot
0
460
AIとSREで「今」できること
honmarkhunt
3
690
日経電子版 for Android の技術的課題と取り組み(令和最新版)/android-20250423
nikkei_engineer_recruiting
1
610
PagerDuty×ポストモーテムで築く障害対応文化/Building a culture of incident response with PagerDuty and postmortems
aeonpeople
3
540
クラウド開発環境Cloud Workstationsの紹介
yunosukey
0
220
白金鉱業Meetup_Vol.18_AIエージェント時代のUI/UX設計
brainpadpr
1
270
持続可能なドキュメント運用のリアル: 1年間の成果とこれから
akitok_
1
270
生成AIのユースケースをとにかく集めてまるっと学ぶ!/ all about generative ai usecases
gakumura
3
360
Featured
See All Featured
Practical Orchestrator
shlominoach
187
11k
Fireside Chat
paigeccino
37
3.4k
Done Done
chrislema
184
16k
The Language of Interfaces
destraynor
157
25k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
119
51k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
Documentation Writing (for coders)
carmenintech
71
4.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Site-Speed That Sticks
csswizardry
6
530
Transcript
܅ ͷ ໊ ɻ ୀձͨ͠Ϣʔβ 0UFNBDIJSC 4IV0("8"3" !FYQBKQ 1IPUPCZ/FJM3PTFOTUFDI
PO6OTQMBTI
1 !
Rails
n & %(@expajp) – ! – 3
– Ruby/Rails(1 • Project Euler 100 • Vue.js+ – # ' " – *$ )
CM
View
n post creatornil
n post
n DB posts ! user_id NULL " 0 #
n post
n DB posts ! user_id NULL " 0 #
,
n B83+,.02@A' " % – ,.020 ;E(15*,47<: $#D=
n View6-/)'C9 ? " % &" – View!6-/)'? – DRY>%
n & #$ n
'!" %
N+1
N+1 Q . L S 0 N Q . 11
N+1 / Eager Loading - Rails Webook https://ruby-rails.hatenadiary.com/entry/20141108/1415418367 ’’
N+1 n DB
→
٫Լʂ
CTO
n Active Record/. creator_id0 - * n Decorator,#4(
*&!)$+ " → post'%*&!)30$+ → DRY21
Active Record
Decorator
View
ҟٞ͋Γʂ
CH*-&0c$a2&16$ >TO@L&Kg\N MB/&K$ ;5&F Z$ [Ra2 VI% 43$QWU *-&P
D$a2Gb# $ $ SY9X`d$=^!A]?(.+'),JE" $a2&<7:f_<$ The WyCash Portfolio Management System http://c2.com/doc/oopsla92.html heSY8TO - Wikipedia ’’
n 06:?)<5DE n Decorator7*F2(> +' -4@1% –
"#! . n gem9(,38C – B/) & ;A3 $/=
NullUser, SystemUser
n Decorator Post creator n User
full_name n Post NullUser, SystemUser – full_name ! n creator User, NullUser, SystemUser
User
NullUser, SystemUser
Post
!
n DB5-6 & %!* #($). –
View,1 '! n 70+4 "*/ 32
n )$ " !'( n
View#*%&
1. 2.
3. NullUser, SystemUser
!
n ;&B5$ – ?< 12$'*/+-@ – full_nameA03 %
n ;D …… – 89" FE – DRY" n ;&,(-.4=6,). C :$# >7 !
n (#&')!% #@ n Rails0-= – *"$!,E?28DRYF<251A
– I74C>6 n +3D 9:HJ;B – /.G+3D