好吧,我有一个文件PerformerSource
,MonthlyEarning
其中有一个名为performer_id
class PerformerSource
....
field :performer_id,:type => Integer
....
....
end
class MonthlyEarning
....
field :performer_id,:type => Integer
....
....
end
现在我只想设置has_many
两个文档之间的关系,并记住 performer_id 即
performer_source has_many monthly_earnings
monthly_earning belongs_to performer_source
我认为在 Mongoid 中不允许以下内容,因为显然当我设置关系时它不会返回任何内容
但如果确实如此,请告诉我