Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
【2018/04/12 Otemachi.rb#5】has_one :throughの憂鬱
Shu OGAWARA
April 12, 2018
Technology
0
300
【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
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
1.6k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
33k
【2019/07/06 TamaRuby会議01】brainf*ck処理系で理解するパターンマッチングをつかった疎結合な実装
expajp
2
2.1k
その正規表現、異議あり! 〜 ReDoSについて
expajp
2
3.8k
【2018/12/08 RailsDM】「あの人」に学ぶ!駆け出しRailsエンジニアの日常の過ごし方
expajp
8
1.1k
【2018/09/18 Otemachi.rb#9】君(退会したユーザ)の名は。
expajp
0
410
【2018/07/29 TokyuRuby会議12】Project Eulerから生まれたワンライナーたち
expajp
0
440
【2018/07/10 Otemachi.rb#8】情報収集どうしてますか?
expajp
0
570
しくじり先生「新卒2年目の転職」
expajp
3
2.8k
Other Decks in Technology
See All in Technology
MarvelClient Upgrade 64bit クライアントへの自動アップグレード設定
mitsuru_katoh
0
140
NGINXENG JP#2 - 4-NGINX-エンジニアリング勉強会
hiropo20
0
120
ChatGPT for Hacking
anugrahsr
0
4.4k
初めてのデータ移行プロジェクトから得た学び
tjmtmmnk
0
290
Hatena Engineer Seminar #23 「チームとプロダクトを育てる Mackerel 開発合宿」
arthur1
0
450
cdk deployに必要な権限ってなんだ?
kinyok
0
170
SignalR を使ったアプリケーション開発をより快適に!
nenonaninu
0
620
Multi-Cloud Gatewayでデータを統治せよ!/ Data Federation with MCG
tutsunom
1
230
Periodic Multi-Agent Path Planning
hziwara
0
110
Cloudflare Workersで動くOG画像生成器
aiji42
1
490
エアドロップ for オープンソースプロジェクト
epicsdao
0
390
グローバルチームことはじめ / Bootstrapping a global team
tasshi
1
690
Featured
See All Featured
Debugging Ruby Performance
tmm1
67
11k
Bootstrapping a Software Product
garrettdimon
299
110k
From Idea to $5000 a Month in 5 Months
shpigford
374
44k
No one is an island. Learnings from fostering a developers community.
thoeni
12
1.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
2
400
Faster Mobile Websites
deanohume
295
29k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
500
130k
Building Better People: How to give real-time feedback that sticks.
wjessup
346
17k
The Power of CSS Pseudo Elements
geoffreycrofte
52
4.3k
Stop Working from a Prison Cell
hatefulcrawdad
263
18k
Art, The Web, and Tiny UX
lynnandtonic
284
18k
WebSockets: Embracing the real-time Web
robhawkes
58
6k
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 ' $