ruby-on-railsrubygemssearchlogic

Rails - Searchlogic to search condition as an array of value


I have two models Employee & Unit. Unit has many Employees. I am using SearchLogic to search employee model. What is the equivalent of below SQL in Searchlogic

employees.unit_id IN (1,2,3)

I have tried both

unit_id_equals_all[] 
unit_id_equals_any[]

But nothing works. Can anyone help?

Thanks, Abhilash


Solution

  • Employee.unit_id_equals([1, 2, 3])