binarylogic / searchlogic

Searchlogic provides object based searching, common named scopes, and other useful tools.
http://rdoc.info/projects/binarylogic/searchlogic
MIT License
1.39k stars 133 forks source link

OR conditions with multiple different parameters (feature request) #118

Open gamov opened 13 years ago

gamov commented 13 years ago

The documentation states:

User.id_or_age_lt_or_username_or_first_name_begins_with(10)
  => "id < 10 OR age < 10 OR username LIKE 'ben%' OR first_name like 'ben%'"

But I believe this is wrong and the result should be:

"id < 10 OR age < 10 OR username LIKE '10%' OR first_name like '10%'"

However, I would love to get the result as it is stated in the doc. I suppose it would imply a call like this (listing params in the order they are declared in the method name): User.id_or_age_lt_or_username_or_first_name_begins_with(10,'ben')

That would be awesome!