Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
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
130
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
5k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
430
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.6k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
540
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
480
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
Bedrock AgentCore Evaluationsで学ぶLLM as a judge入門
shichijoyuhi
2
240
【開発を止めるな】機能追加と並行して進めるアーキテクチャ改善/Keep Shipping: Architecture Improvements Without Pausing Dev
bitkey
PRO
1
130
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
1.4k
2025-12-27 Claude CodeでPRレビュー対応を効率化する@機械学習社会実装勉強会第54回
nakamasato
2
220
まだ間に合う! Agentic AI on AWSの現在地をやさしく一挙おさらい
minorun365
17
2.7k
AI との良い付き合い方を僕らは誰も知らない
asei
0
250
Strands Agents × インタリーブ思考 で変わるAIエージェント設計 / Strands Agents x Interleaved Thinking AI Agents
takanorig
5
2k
事業の財務責任に向き合うリクルートデータプラットフォームのFinOps
recruitengineers
PRO
2
200
AWSの新機能をフル活用した「re:Inventエージェント」開発秘話
minorun365
2
440
[2025-12-12]あの日僕が見た胡蝶の夢 〜人の夢は終わらねェ AIによるパフォーマンスチューニングのすゝめ〜
tosite
0
170
ESXi のAIOps だ!2025冬
unnowataru
0
350
Featured
See All Featured
Music & Morning Musume
bryan
46
7k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
30
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
400
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
290
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
How to build a perfect <img>
jonoalderson
0
4.7k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Deep Space Network (abreviated)
tonyrice
0
21
Digital Ethics as a Driver of Design Innovation
axbom
PRO
0
130
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
2
65
Highjacked: Video Game Concept Design
rkendrick25
PRO
0
250
Technical Leadership for Architectural Decision Making
baasie
0
180
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 ' $