searchlogic を使用していたときは、次のように使用できました。
27 # @todos = Todo.contact_user_id_is(current_user).
28 # contact_campaign_id_is(@campaign).
29 # current_date_lte(Date.today).
30 # done_date_null.
31 # ascend_by_contact_id.
32 # ascend_by_current_date
たとえば、Todo レコードに属する連絡先に属するキャンペーンを検索できます。
これは私が試したものです(ソートの方法がわからない:
22 @todos = Todo.joins(:contacts).where(:user_id.eq => current_user,
23 :contacts => { :campaign_id.eq => @campaign.id},
24 :current_date.lteq => Date.today,
25 :done_date.not_eq => nil)
metawhere でそのようなことを行うにはどうすればよいですか?