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
440
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
【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
160
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
170
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
7k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
560
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.9k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
630
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
530
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.5k
Other Decks in Technology
See All in Technology
AAIFに入ってみた ~内から見えるコミュニティ動向~
sato4
0
190
【Cyber-sec+】経営層を"動かす"ための考え方
hssh2_bin
0
170
2026 TECHFRESH 畢業分享會 - AI-Native 重塑軟體工程與虛擬講師
line_developers_tw
PRO
0
960
【NRUG vol.18】KubernetesにおけるNew Relicデータ取得量削減の考え方
nrug_member
0
110
20260619 私の日常業務での生成 AI 活用
masaruogura
1
190
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.9k
人材育成分科会.pdf
_awache
3
190
ルールやカスタム機能、どう活かす?ハンズオンで体感するIBM Bobの出力コントロール
muehara
1
150
2026TECHFRESH畢業分享會 - 原生還是跨平台? App 開發踩坑實錄
line_developers_tw
PRO
0
970
Bedrock AgentCore RuntimeでAuth0 Changelog調査AIをアップグレードした話
t5u8a5a
1
120
プロダクト開発から業務改善コンサルまで。事業全体へ「染み出す」ことで広がるエンジニアの可能性
ham0215
0
120
AIエージェントが名古屋の猛暑からあなたを守る
happysamurai294
0
110
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
730
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
590
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
170
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Odyssey Design
rkendrick25
PRO
2
700
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
170
Paper Plane (Part 1)
katiecoart
PRO
0
8.9k
From π to Pie charts
rasagy
0
210
WCS-LA-2024
lcolladotor
0
630
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
480
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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 ' $