activerecord-hackery / meta_search

Object-based searching (and more) for simply creating search forms. Not currently maintained.
http://erniemiller.org/2013/11/17/anyone-interested-in-activerecord-hackery/
MIT License
903 stars 140 forks source link

or but not and ? #41

Closed ghost closed 13 years ago

ghost commented 13 years ago

Hi, I try to explain my idea i have 2 value in database : "min." and "max." I need to search all items where the value (type by users in search form) is in this 2 points.

I try in form : text_field :min.gte text_field :max.lte

i need min.gte AND max.lte, but the metasearch make min.gte OR max.lte

I try text_field :eq_hab_mini_eq_hab_max_all ,doesn't work!

i don't know how to use multiparameter-between in this case, with to different DB column name.

Is it possible to make a option AND with 2 text_field or in the multiparameter_field.

Thx

ernie commented 13 years ago

One suggestion: yry Ransack, which allows for both and/or. This isn't somethign I'm going to be adding to metasearch at this point.

You might also consider creating a custom where, which takes two parameters and does the query you mentioned.