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
380
【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
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
1
140
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
5
1.9k
エンジニアリングマネージャーはどう学んでいくのか #devsumi / How Do Engineering Managers Continue to Learn and Grow?
expajp
8
4.4k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
430
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
410
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.2k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
39k
【2019/07/06 TamaRuby会議01】brainf*ck処理系で理解するパターンマッチングをつかった疎結合な実装
expajp
2
2.7k
その正規表現、異議あり! 〜 ReDoSについて
expajp
2
5.6k
Other Decks in Technology
See All in Technology
セマンティックレイヤー入門
ikkimiyazaki
7
2k
RubyKaigi で得た課題解決法・美意識・モチベーション
morihirok
0
190
移行できそうでやりきれなかった 10年超えのシステムを葬るための戦略 / phper-kaigi-2025-ryu
carta_engineering
0
660
SpannerとAurora DSQLの同時実行制御の違いに想いを馳せる
masakikato5
0
350
パスキーでのログインを 実装してみよう!
hibiki_cube
0
520
一人QA時代が終わり、 QAチームが立ち上がった話
ma_cho29
0
210
組織に持ち込む脅威モデリング
nikinusu
3
690
みんなで育てるNewsPicksのSLO
troter
4
1k
RubyKaigi 2025でプロポーザルが初めて採択されるまでにやったこと
yuuu
1
150
【ServiceNow SNUG Meetup LT deck】ServiceNow「検索性の進化」ZingからNow Assistまで
niwato
1
270
AI の活用における課題と現状、今後の期待
asei
4
350
EMの仕事、あるいは顧客価値創出のアーキテクト
radiocat
0
120
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
Faster Mobile Websites
deanohume
306
31k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
A designer walks into a library…
pauljervisheath
205
24k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Become a Pro
speakerdeck
PRO
26
5.2k
Unsuck your backbone
ammeep
669
57k
The Pragmatic Product Professional
lauravandoore
33
6.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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 ' $