升级到Rail4时,我将条件更改为模型中的位置,但我现在收到语法错误(语法错误,意外'}',期待关键字_end)
has_many :businesses, through: :business_admins, { where business_admins: { state: 'accepted'} }
答案 0 :(得分:0)
将其更改为:
has_many :businesses,
-> { where(business_admins: { state: 'accepted'}) },
through: :business_admins