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/04/12 Otemachi.rb#5】has_one :throughの憂鬱
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Shu OGAWARA
April 12, 2018
Technology
430
0
Share
【2018/04/12 Otemachi.rb#5】has_one :throughの憂鬱
2018/04/12 Otemachi.rb#5での発表資料です。
Shu OGAWARA
April 12, 2018
More Decks by Shu OGAWARA
See All by Shu OGAWARA
人生を変えた一冊「独学大全」のはなし / Self-study ENCYCLOPEDIA: The Book Which Change My Life #独学大全 #EM推し本
expajp
0
150
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
150
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
6.6k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
550
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
5
2.1k
エンジニアリングマネージャーはどう学んでいくのか #devsumi / How Do Engineering Managers Continue to Learn and Grow?
expajp
9
5.8k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
620
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
510
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.4k
Other Decks in Technology
See All in Technology
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
320
「責任あるAIエージェント」こそ自社で開発しよう!
minorun365
9
1.9k
データを"持てない"環境でのアノテーション基盤設計
sansantech
PRO
1
110
扱える不確実性を増やしていく - スタートアップEMが考える「任せ方」
kadoppe
0
300
自分のハンドルは自分で握れ! ― 自分のケイパビリティを増やし、メンバーのケイパビリティ獲得を支援する ― / Take the wheel yourself
takaking22
1
900
弁護士ドットコム株式会社 エンジニア職向け 会社紹介資料
bengo4com
1
150
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
4
23k
AI バイブコーティングでキーボード不要?!
samakada
0
550
AI時代 に増える データ活用先
takahal
0
220
20260423_執筆の工夫と裏側 技術書の企画から刊行まで / From the planning to the publication of technical book
nash_efp
3
390
QGISプラグイン CMChangeDetector
naokimuroki
1
390
60分で学ぶ最新Webフロントエンド
mizdra
PRO
35
19k
Featured
See All Featured
Design in an AI World
tapps
0
190
Scaling GitHub
holman
464
140k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
260
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
810
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Ruling the World: When Life Gets Gamed
codingconduct
0
210
Mind Mapping
helmedeiros
PRO
1
150
Docker and Python
trallard
47
3.8k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
170
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Transcript
2018/04/12 Otemachi.rb#5 has_one :through Shu OGAWARA (@expajp)
35* n /$ .(@expajp) – &' • 3!2! –
Ruby/Rails210, – -+ – )1#"%( – 6+4
1 1 n
n
1 1 n
n
1 1 n
n has_many :through
1 1 n
n has_one :through has_many :through
has_many :through has_ many belongs_ to
has_ many belongs_ to
has_one :through has_ one belongs_ to
has_ one belongs_ to
Matter Contact User
n N+1 Query n
n matter.main_operator
scope n ' n 1"&
# %)!( n $
has_one :through n through
has_one :through n through
has_one :through n through " ! n
conditions -> { where(…) } #
n ## $( $ % n has_one :through &%!
" n ' $