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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Shu OGAWARA
April 12, 2018
Technology
430
0
Share
【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
150
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
150
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
6.6k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
550
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.8k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
620
わたしのメタ学習 / 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
プラットフォームエンジニアリングの実践 - AWS コンテナサービスで構築する社内プラットフォーム / AWS Containers Platform Meetup #1
literalice
1
120
60分で学ぶ最新Webフロントエンド
mizdra
PRO
35
19k
Shipping AI Agents — Lessons from Production
vvatanabe
0
210
Rapid Start: Faster Internet Connections, with Ruby's Help
kazuho
2
280
AWS認定資格は本当に意味があるのか?
nrinetcom
PRO
2
270
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
78k
マルチエージェント × ハーネスエンジニアリング × GitLab Duo Agent Platformで実現する「AIエージェントに仕事をさせる時代へ。」 / 20260421 GitLab Duo Agent Platform
n11sh1
0
150
最初の一歩を踏み出せなかった私が、誰かの背中を押したいと思うようになるまで / give someone a push
mii3king
0
160
Bill One 開発エンジニア 紹介資料
sansan33
PRO
6
18k
Hacobu Tech Deck
hacobu
PRO
0
110
AI駆動1on1〜AIに自分を育ててもらう〜
yoshiakiyasuda
0
120
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.3k
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
99
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Paper Plane (Part 1)
katiecoart
PRO
0
6.6k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
350
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
190
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
180
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
New Earth Scene 8
popppiees
3
2.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to Ace a Technical Interview
jacobian
281
24k
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 ' $