我有这个模型:
class Document1
field privacy
has_many events, :as => :target
end
class Document2
field privacy
has many_events, :as => :target
end
class Event
belongs_to :target, :polymorphic => true
end
我需要做类似的事情:
Event.where( :target.privacy => :public )
我该怎么做?