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
Shu OGAWARA
April 12, 2018
Technology
0
430
【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
人生を変えた一冊「独学大全」のはなし / Self-study ENCYCLOPEDIA: The Book Which Change My Life #独学大全 #EM推し本
expajp
0
110
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
150
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
6.3k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
530
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.7k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
600
わたしのメタ学習 / 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
スクリプトの先へ!AIエージェントと組み合わせる モバイルE2Eテスト
error96num
0
180
Sansanでの認証基盤内製化と移行
sansantech
PRO
0
450
Claude Code 2026年 最新アップデート
oikon48
13
10k
楽しく学ぼう!ネットワーク入門
shotashiratori
4
3.3k
The_Evolution_of_Bits_AI_SRE.pdf
nulabinc
PRO
0
210
猫でもわかるKiro CLI(AI 駆動開発への道編)
kentapapa
0
210
Claude Codeの進化と各機能の活かし方
oikon48
22
13k
Agent ServerはWeb Serverではない。ADKで考えるAgentOps
akiratameto
0
110
AI時代のSaaSとETL
shoe116
1
150
AIエージェント時代に備える AWS Organizations とアカウント設計
kossykinto
3
980
DevOpsエージェントで実現する!! AWS Well-Architected(W-A) を実現するシステム設計 / 20260307 Masaki Okuda
shift_evolve
PRO
3
780
Dr. Werner Vogelsの14年のキーノートから紐解くエンジニアリング組織への処方箋@JAWS DAYS 2026
p0n
1
130
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.6k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
110
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
300
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Designing Powerful Visuals for Engaging Learning
tmiket
0
270
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
150
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
130
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
72
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
120
Practical Orchestrator
shlominoach
191
11k
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 ' $