問題我有這個有很多通過我的模型出於某種原因,我不斷收到此錯誤和幫助將不勝感激。有很多通過關聯不工作在升級導軌3到導軌4應用
錯誤
ActiveRecord::HasManyThroughAssociationNotFoundError (Could not find the association #<Proc:[email protected]/home/dev/testapp/app/models/work_order.rb:12> in model WorkOrder)
:
has_many :demand_supply_links,
:through => proc {"select * from demand_supply_link
where supply_type = 'WO'" +
" and supply_base_id = '" + "#{base_id}" +
"' and supply_lot_id = '" + "#{lot_id}" +
"' and supply_split_id = '" + "#{split_id}" + "'"}
,我使用低谷協會
def setup(session)
if [email protected]_order.nil?
@demand_supply = @work_order.demand_supply_links.first
end
end
發佈您的代碼包含模型協會 – Bijendra
我編輯我的問題@Bijendra – Snowman288