0
我有一個資源模型和模型的ResourceType之間的關係have_and_belong_to_many。如何使用找到相關的模型和條件
我試圖找到通過的ResourceType與加入的所有資源:名字不等於「事件」。
我有工作,這樣我可以找到資源與ResourceType.names等於「事件」是這樣的:
Resource.find(:all, :order => 'created_at DESC', :include => :resource_types, :conditions => {:resource_types => {:name => 'event'}})
,但我想找到一切有:名稱=「事件」!
感謝您的幫助!
謝謝!這就是我一直在尋找的! – Lee 2011-04-13 15:18:16