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
490
【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
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.1k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
410
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
400
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.6k
その正規表現、異議あり! 〜 ReDoSについて
expajp
2
5.6k
【2018/12/08 RailsDM】「あの人」に学ぶ!駆け出しRailsエンジニアの日常の過ごし方
expajp
10
1.3k
Other Decks in Technology
See All in Technology
技術負債の「予兆検知」と「状況異変」のススメ / Technology Dept
i35_267
1
1.1k
モノレポ開発のエラー、誰が見る?Datadog で実現する適切なトリアージとエスカレーション
biwashi
6
800
Building Products in the LLM Era
ymatsuwitter
10
5.4k
バックエンドエンジニアのためのフロントエンド入門 #devsumiC
panda_program
18
7.5k
偶然 × 行動で人生の可能性を広げよう / Serendipity × Action: Discover Your Possibilities
ar_tama
1
1.1k
SA Night #2 FinatextのSA思想/SA Night #2 Finatext session
satoshiimai
1
140
滅・サービスクラス🔥 / Destruction Service Class
sinsoku
6
1.6k
自動テストの世界に、この5年間で起きたこと
autifyhq
10
8.5k
Classmethod AI Talks(CATs) #17 司会進行スライド(2025.02.19) / classmethod-ai-talks-aka-cats_moderator-slides_vol17_2025-02-19
shinyaa31
0
120
Tech Blogを書きやすい環境づくり
lycorptech_jp
PRO
1
240
レビューを増やしつつ 高評価維持するテクニック
tsuzuki817
1
700
抽象化をするということ - 具体と抽象の往復を身につける / Abstraction and concretization
soudai
15
3.3k
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
What's in a price? How to price your products and services
michaelherold
244
12k
Speed Design
sergeychernyshev
27
790
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
174
51k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
9
440
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
A Tale of Four Properties
chriscoyier
158
23k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
We Have a Design System, Now What?
morganepeng
51
7.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
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