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
430
【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
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
110
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
1.9k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
36k
【2019/07/06 TamaRuby会議01】brainf*ck処理系で理解するパターンマッチングをつかった疎結合な実装
expajp
2
2.5k
その正規表現、異議あり! 〜 ReDoSについて
expajp
2
4.9k
【2018/12/08 RailsDM】「あの人」に学ぶ!駆け出しRailsエンジニアの日常の過ごし方
expajp
8
1.2k
【2018/07/29 TokyuRuby会議12】Project Eulerから生まれたワンライナーたち
expajp
0
540
【2018/07/10 Otemachi.rb#8】情報収集どうしてますか?
expajp
0
620
しくじり先生「新卒2年目の転職」
expajp
3
3.1k
Other Decks in Technology
See All in Technology
ServiceNow Knowledge Learning Rise up
manarobot
0
190
2024/4/26 コンピュータ歴史博物館解説告知
toshi_atsumi
0
210
ChatGPT for IT Service Management (IT Pro)
dahatake
7
1.4k
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
110
私が trocco を推す理由
__allllllllez__
1
190
Google Cloud Next '24でブログを10本書いた方法と勉強会を沸かせた方法
yasumuusan
0
250
Hands-on Gemini, the Google DeepMind LLM
meteatamel
1
110
ServiceNow Knowledge 24の歩き方 EYストラテジー・アンド・コンサルティング
manarobot
0
170
どうするコスト最適化のトレードオフ
tetsuyaooooo
1
450
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
3
460
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
3
4.6k
Databricks における 『MLOps』
databricksjapan
2
160
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
163
13k
How GitHub (no longer) Works
holman
304
140k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
19
1.9k
A better future with KSS
kneath
231
16k
Become a Pro
speakerdeck
PRO
10
4.5k
Bootstrapping a Software Product
garrettdimon
PRO
301
110k
Code Reviewing Like a Champion
maltzj
513
39k
In The Pink: A Labor of Love
frogandcode
138
21k
GraphQLとの向き合い方2022年版
quramy
31
12k
Fantastic passwords and where to find them - at NoRuKo
philnash
36
2.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
15
2.6k
The Pragmatic Product Professional
lauravandoore
24
5.8k
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