4
我有一個軌道4驗證了我的用戶模型:軌道4語法早該匹配器「have_many」與「秩序」
has_many :items, -> { order(:position) }
我期待下面早該匹配的工作:
it {should have_many(:items).order(:position)}
但它提出了這樣的錯誤:
Expected User to have a has_many association called items (items should be ordered by position)
是我的語法錯誤的,工商業污水附加費T'
謝謝。這是問題所在。 –
@MichaelvanHolst [接受](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)答案是否正確 – gotva
@MichaelvanHolst你能接受答案,以便其他人看到這個? –