Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
【2018/04/12 Otemachi.rb#5】has_one :throughの憂鬱
Search
Shu OGAWARA
April 12, 2018
Technology
450
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
210
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
190
入門 FormObject / An Introduction to FormObject #kaigionrails
expajp
2
7.9k
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
600
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
6k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
660
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
560
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
30座EKS, 180次升級淬煉的EKS Upgrade Skill 的歷程
eric8230
0
170
「ピッケル本」日本語版は4.0(第6版)が出版されるべき / pickaxe4-nagoyark05
kakutani
1
140
Minecraft JavaのMODをSwiftで作る
1mash0
0
170
生成AIエージェントを用いた、 手動テスト手順書から自動テストへの 変換手法の検討
magicpod
0
160
ユーザー価値を届け続けるためにウォンテッドリーが大切にしている文化
kotaminato
0
160
作品が生態系になった ─ Mini Tokyo 3D から世界へ
nagix
0
190
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
150
積み重なった技術負債への挑戦 〜初手としての全社ゴト化〜
techtekt
PRO
0
1.3k
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
830
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
9
960
空間オーディオで過去の 自分(ゴースト)と競うランニング 〜HealthKitのルートを足音に変える実装〜
nao_randd
0
220
[2026-09-11]SREは誰のもの?運用エンジニアが始める 「SRE領域への越境」とチームの進化の軌跡 〜Road to NEXT CRE
tosite
0
290
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1369
210k
The browser strikes back
jonoalderson
0
1.7k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
We Have a Design System, Now What?
morganepeng
55
8.3k
Are puppies a ranking factor?
jonoalderson
2
3.9k
Exploring anti-patterns in Rails
aemeredith
4
510
The Invisible Side of Design
smashingmag
301
52k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
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 ' $