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
420
【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
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
140
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
5.4k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
440
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.6k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
550
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
490
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.4k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
40k
Other Decks in Technology
See All in Technology
一番人に近いコードレビューア CodeRabbit
kinopeee
0
110
かわいい身体と声を持つ そういうものに私はなりたい
yoshimura_datam
0
420
エンジニアとして長く走るために気づいた2つのこと_大賀愛一郎
nanaism
1
250
Data Intelligence on Lakehouse Paradigm
scotthsieh825
0
200
AI開発をスケールさせるデータ中心の仕組みづくり
kzykmyzw
0
140
習慣とAIと環境 — 技術探求を続ける3つの鍵
azukiazusa1
3
770
OCI技術資料 : OS管理ハブ 概要
ocise
2
4.2k
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
72k
【Oracle Cloud ウェビナー】[Oracle AI Database + Azure] AI-Ready データ戦略の最短ルート:Azure AIでビジネス データの価値を最大化
oracle4engineer
PRO
2
110
kintone開発のプラットフォームエンジニアの紹介
cybozuinsideout
PRO
0
590
新規事業における「一部だけどコア」な AI精度改善の優先順位づけ
zerebom
0
150
「AIでできますか?」から「Agentを作ってみました」へ ~「理論上わかる」と「やってみる」の隔たりを埋める方法
applism118
5
4k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
210
24k
The SEO identity crisis: Don't let AI make you average
varn
0
56
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
95
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
110
Deep Space Network (abreviated)
tonyrice
0
35
Tell your own story through comics
letsgokoyo
1
800
Accessibility Awareness
sabderemane
0
42
The Spectacular Lies of Maps
axbom
PRO
1
450
Speed Design
sergeychernyshev
33
1.5k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
97
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
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 ' $