jeudi 10 septembre 2015

Sarchkick issue: A and (B or C)

I have this query:

City.search(@query, where: {
  activated: true,
  available: true,
  or: [
    [
      { country_id: [92, 95] },
      { admin_code_id: [922, 927] }
    ]
  ]
}).

But i think the where hash is not good, because the thing i want to do is:

activated AND available AND (country_id IN [92, 95] OR admin_code_id IN [922, 927])

I tried a lot of different syntax, but nothing work for me.

Aucun commentaire:

Enregistrer un commentaire