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.1k
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
デスクトップだけじゃないUbuntu
mtyshibata
0
550
CDKのコードを書く環境を作りました with Amazon Q
nobuhitomorioka
1
110
プロダクトエンジニア構想を立ち上げ、プロダクト志向な組織への成長を続けている話 / grow into a product-oriented organization
hiro_torii
1
290
データ資産をシームレスに伝達するためのイベント駆動型アーキテクチャ
kakehashi
PRO
2
600
クラウドサービス事業者におけるOSS
tagomoris
3
950
PHPで印刷所に入稿できる名札データを作る / Generating Print-Ready Name Tag Data with PHP
tomzoh
0
140
Tech Blogを書きやすい環境づくり
lycorptech_jp
PRO
1
260
室長と気ままに学ぶマイクロソフトのビジネスアプリケーションとビジネスプロセス
ryoheig0405
0
370
2024.02.19 W&B AIエージェントLT会 / AIエージェントが業務を代行するための計画と実行 / Algomatic 宮脇
smiyawaki0820
15
4k
Active Directory攻防
cryptopeg
PRO
7
4.4k
人はなぜISUCONに夢中になるのか
kakehashi
PRO
6
1.7k
Exadata Database Service on Cloud@Customer セキュリティ、ネットワーク、および管理について
oracle4engineer
PRO
1
1.5k
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Into the Great Unknown - MozCon
thekraken
35
1.6k
Raft: Consensus for Rubyists
vanstee
137
6.8k
Optimizing for Happiness
mojombo
376
70k
The Invisible Side of Design
smashingmag
299
50k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
Faster Mobile Websites
deanohume
306
31k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
How to Think Like a Performance Engineer
csswizardry
22
1.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
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 ' $