2014-09-19 23 views

回答

1

看看has_many :through Association

在你的情況,你可以添加以下到您的Organization模型

has_many :items, through: :boxes 

然後你就可以寫這樣的事:Organization.find_by(id: ..., name: ....).items

+0

這似乎是完全合理的!我正在考慮加入,但可能沒有必要。謝謝 – cheeseandpepper 2014-09-19 17:01:39

相關問題