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
400
【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
あなたの「仮説検証」、ゆがんでいませんか? / Isn't Your "Hypothesis Verification" Distorted? #emoasis
expajp
2
340
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
5
2k
エンジニアリングマネージャーはどう学んでいくのか #devsumi / How Do Engineering Managers Continue to Learn and Grow?
expajp
8
4.9k
RubyKaigi参加歴をふりかえる / Looking Back on My RubyKaigi Participation History #kaigieffectLT
expajp
3
490
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
450
ActiveSupport::Concernで開くメタプログラミングの扉 #heiseirubykaigi / The door of meta-programing is opened by ActiveSupport::Concern
expajp
1
2.3k
実践Railsアプリケーション設計 #meetup_rails / Practical Rails Application Design
expajp
4
39k
【2019/07/06 TamaRuby会議01】brainf*ck処理系で理解するパターンマッチングをつかった疎結合な実装
expajp
2
2.7k
その正規表現、異議あり! 〜 ReDoSについて
expajp
2
5.8k
Other Decks in Technology
See All in Technology
How Community Opened Global Doors
hiroramos4
PRO
1
120
MySQL5.6から8.4へ 戦いの記録
kyoshidaxx
1
260
AIとともに進化するエンジニアリング / Engineering-Evolving-with-AI_final.pdf
lycorptech_jp
PRO
0
110
米国国防総省のDevSecOpsライフサイクルをAWSのセキュリティサービスとOSSで実現
syoshie
2
1.2k
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
26k
SalesforceArchitectGroupOsaka#20_CNX'25_Report
atomica7sei
0
200
生成AI時代 文字コードを学ぶ意義を見出せるか?
hrsued
1
620
Prox Industries株式会社 会社紹介資料
proxindustries
0
330
ドメイン特化なCLIPモデルとデータセットの紹介
tattaka
1
200
Microsoft Build 2025 技術/製品動向 for Microsoft Startup Tech Community
torumakabe
2
310
Leveraging Open-Source Tools for Creating 3D Tiles in the Urban Environment
simboss
PRO
0
110
Amazon Bedrockで実現する 新たな学習体験
kzkmaeda
2
610
Featured
See All Featured
Optimizing for Happiness
mojombo
379
70k
Scaling GitHub
holman
459
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Unsuck your backbone
ammeep
671
58k
Adopting Sorbet at Scale
ufuk
77
9.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
670
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Building Applications with DynamoDB
mza
95
6.5k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
BBQ
matthewcrist
89
9.7k
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 ' $