나는이 모델이 곳에서의 사용 관계 필드 :Mongoid 쿼리
나는 같은 것을 할 필요가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)
내가 그것을 어떻게 할 수 있습니까?
몽고 이드에서 저에게 효과적이지 않습니다. 항상 0 개의 결과를 반환합니다 : Event.where ('target.privacy'=> : public) – drinor