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
520
【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
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
4.2k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
410
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
5
2.1k
エンジニアリングマネージャーはどう学んでいくのか #devsumi / How Do Engineering Managers Continue to Learn and Grow?
expajp
8
5.5k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
530
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
470
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.3k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
40k
【2019/07/06 TamaRuby会議01】brainf*ck処理系で理解するパターンマッチングをつかった疎結合な実装
expajp
2
2.7k
Other Decks in Technology
See All in Technology
自己的售票系統自己做!
eddie
0
440
プログラミング言語を書く前に日本語を書く── AI 時代に求められる「言葉で考える」力/登壇資料(井田 献一朗)
hacobu
PRO
0
160
コード1ミリもわからないけど Claude CodeでFigjamプラグインを作った話
abokadotyann
1
160
機密情報の漏洩を防げ! Webフロントエンド開発で意識すべき漏洩パターンとその対策
mizdra
PRO
8
3.1k
大規模プロダクトで実践するAI活用の仕組みづくり
k1tikurisu
1
480
隙間ツール開発のすすめ / PHP Conference Fukuoka 2025
meihei3
0
410
【M3】攻めのセキュリティの実践!プロアクティブなセキュリティ対策の実践事例
axelmizu
0
110
Flutterで実装する実践的な攻撃対策とセキュリティ向上
fujikinaga
2
380
QAセントラル組織が運営する自動テストプラットフォームの課題と現状
lycorptech_jp
PRO
0
390
「O(n log(n))のパフォーマンス」の意味がわかるようになろう
dhirabayashi
0
130
[mercari GEARS 2025] Keynote
mercari
PRO
0
210
はじめての OSS コントリビューション 〜小さな PR が世界を変える〜
chiroito
4
270
Featured
See All Featured
Statistics for Hackers
jakevdp
799
220k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
1.8k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
The Invisible Side of Design
smashingmag
302
51k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.1k
Designing Experiences People Love
moore
142
24k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
2.9k
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