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
0
420
【2018/04/12 Otemachi.rb#5】has_one :throughの憂鬱
2018/04/12 Otemachi.rb#5での発表資料です。
Shu OGAWARA
April 12, 2018
Tweet
Share
More Decks by Shu OGAWARA
See All by Shu OGAWARA
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
140
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
5.4k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
440
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.6k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
550
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
490
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.4k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
40k
Other Decks in Technology
See All in Technology
Zephyr RTOS の発表をOpen Source Summit Japan 2025で行った件
iotengineer22
0
260
Oracle Cloud Infrastructure:2026年1月度サービス・アップデート
oracle4engineer
PRO
0
120
ReproでのicebergのStreaming Writeの検証と実運用にむけた取り組み
joker1007
0
430
CodeRabbit CLI + Claude Codeの連携について
oikon48
1
640
Databricks Free Edition講座 データエンジニアリング編
taka_aki
0
2.8k
Kaggleコンペティション「MABe Challenge - Social Action Recognition in Mice」振り返り
yu4u
1
750
DEVCON 14 Report at AAMSX RU65: V9968, MSX0tab5, MSXDIY etc
mcd500
0
220
BiDiってなんだ?
tomorrowkey
2
480
かわいい身体と声を持つ そういうものに私はなりたい
yoshimura_datam
0
420
KubeCon + CloudNativeCon NA ‘25 Recap, Extensibility: Gateway API / NRI
ladicle
0
120
なぜCREを8年間続けているのか / cre-camp-4-2026-01-21
missasan
0
1.3k
Security Hub と出会ってから 1年半が過ぎました
rch850
0
180
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
1
220
For a Future-Friendly Web
brad_frost
181
10k
HDC tutorial
michielstock
1
330
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
300
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Discover your Explorer Soul
emna__ayadi
2
1.1k
A Modern Web Designer's Workflow
chriscoyier
698
190k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
130
Paper Plane
katiecoart
PRO
0
46k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
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 ' $