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
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
190
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
180
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
7.4k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
580
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
5
2.2k
エンジニアリングマネージャーはどう学んでいくのか #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
650
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
550
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
AIツールを導入しても生産性はあがらない? カオナビが直面した 3つの壁と乗り越え方。/ Overcoming 3 Barriers to AI-Driven Productivity at kaonavi
kaonavi
0
1.6k
PLaMoを毎日の開発で使い育てていく
pfn
PRO
0
180
エンタープライズデータへ安全につなぐ Production-ready なエージェント設計 ― AI × MCP リファレンスアーキテクチャ ― #AIDevDay
cdataj
1
480
QAと開発の両側から進める AI活用 -QAプロセスAI支援ツールキットと Inner Loop / Outer Loopの取り組み-
legalontechnologies
PRO
2
410
【CEDEC2026】ゲームシナリオライターを支援するAIツール開発の実践 ― 設計とプロンプトの工夫 ―
cygames
PRO
1
600
DevOps Agentで運用判断をチーム資産にする~Agent InstructionsとAgent Skillを継続的に育てる~
fujioka6789
0
200
セキュリティ研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
32
28k
大 AI 時代におけるC# の事情 ~ぶっちゃけトークを交えながら~
nenonaninu
1
650
それでも、技術なブログを書く理由 #kichijojipm / Why I Still Write Tech Blogs Even Now
shinkufencer
0
1.6k
「待ち時間」の消滅と「自我消耗」の加速:生成AI時代のエンジニアを救うメンタル・リソース管理
poropinai1966
0
400
クラウドを使う側から、作る側へ / 大吉祥寺.pm 2026前夜祭
fujiwara3
8
2k
システム監視入門
grimoh
5
800
Featured
See All Featured
Music & Morning Musume
bryan
47
7.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Producing Creativity
orderedlist
PRO
348
40k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
190
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Deep Space Network (abreviated)
tonyrice
0
250
Skip the Path - Find Your Career Trail
mkilby
1
180
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
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 ' $