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
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.2k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
410
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
400
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.6k
その正規表現、異議あり! 〜 ReDoSについて
expajp
2
5.6k
【2018/12/08 RailsDM】「あの人」に学ぶ!駆け出しRailsエンジニアの日常の過ごし方
expajp
10
1.3k
Other Decks in Technology
See All in Technology
Windows の新しい管理者保護モード
murachiakira
0
190
【詳説】コンテンツ配信 システムの複数機能 基盤への拡張
hatena
0
180
一度 Expo の採用を断念したけど、 再度 Expo の導入を検討している話
ichiki1023
1
250
設計を積み重ねてシステムを刷新する
sansantech
PRO
0
130
Two Blades, One Journey: Engineering While Managing
ohbarye
3
700
コンテナサプライチェーンセキュリティ
kyohmizu
1
120
Potential EM 制度を始めた理由、そして2年後にやめた理由 - EMConf JP 2025
hoyo
2
1.6k
ExaDB-XSで利用されているExadata Exascaleについて
oracle4engineer
PRO
3
150
次世代KYC活動報告 / 20250219-BizDay17-KYC-nextgen
oidfj
0
460
Classmethod AI Talks(CATs) #17 司会進行スライド(2025.02.19) / classmethod-ai-talks-aka-cats_moderator-slides_vol17_2025-02-19
shinyaa31
0
170
分解して理解する Aspire
nenonaninu
2
690
Iceberg Meetup Japan #1 : Iceberg and Databricks
databricksjapan
0
280
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
6
250
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Designing for Performance
lara
604
68k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Raft: Consensus for Rubyists
vanstee
137
6.8k
How STYLIGHT went responsive
nonsquared
98
5.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.3k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
Visualization
eitanlees
146
15k
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 ' $