-
Notifications
You must be signed in to change notification settings - Fork 1
Home
mech edited this page Sep 14, 2010
·
10 revisions
Searching can be chained to Criteria#where
and Criteria#in
.
Job.where(:status => "open").search(:q => "engineer")
Company.where(:category => "=REGULAR").search(:q => "Benchmark") # Always expecting :q query
Query: (q0,q1);(q0,q2);(q0,q3)
Explain: q0
is :category
and q1
, q2
and q3
are all the searchable fields in Company
model. This essentially means that q0
criteria need to appear in every searchable fields. You can find what searchable fields there are by calling Company.searchable_fields
.