我有兩個型號看起來像這樣由協會(DataMapper的)
class Stage
include DataMapper::Resource
property :id, Serial
belongs_to :staff
end
class Staff
include DataMapper::Resource
property :id, String, :key => true
property :full_name, String
property :email, String
has n, :stages
end
我試圖找到具有分配一個特定的職員各個階段查找。我試過@stages = Stage.all(Stage.Staff => 'TM')
我在做什麼錯?
謝謝,這很有幫助。 – Tom 2010-07-10 09:35:55