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
480
【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
3.3k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
390
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
370
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.1k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
38k
【2019/07/06 TamaRuby会議01】brainf*ck処理系で理解するパターンマッチングをつかった疎結合な実装
expajp
2
2.6k
その正規表現、異議あり! 〜 ReDoSについて
expajp
2
5.5k
【2018/12/08 RailsDM】「あの人」に学ぶ!駆け出しRailsエンジニアの日常の過ごし方
expajp
10
1.3k
Other Decks in Technology
See All in Technology
kargoの魅力について伝える
magisystem0408
0
200
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
160
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
110
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
440
Amazon SageMaker Unified Studio(Preview)、Lakehouse と Amazon S3 Tables
ishikawa_satoru
0
150
MLOps の現場から
asei
6
630
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
AIのコンプラは何故しんどい?
shujisado
1
190
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
300
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
180
Wantedly での Datadog 活用事例
bgpat
1
410
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Optimising Largest Contentful Paint
csswizardry
33
3k
Designing Experiences People Love
moore
138
23k
Optimizing for Happiness
mojombo
376
70k
Docker and Python
trallard
41
3.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
For a Future-Friendly Web
brad_frost
175
9.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
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