2013-07-16 99 views
1

我正在努力如何去Mongoid的擴展協會所有者。 AFAIK它是ActiveRecords中的proxy_association.owner。Mongoid協會擴展代理所有者

class Something 
    field :some_field 

    has_many :whatevers, extend: ExtraStuff 
end 

module ExtraStuff 
    def recent 
    # I need "some_field" here, but there's no "proxy_association" 
    end 
end 

回答