binarylogic / searchlogic

Searchlogic provides object based searching, common named scopes, and other useful tools.

Home Page:http://rdoc.info/projects/binarylogic/searchlogic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OR conditions with multiple different parameters (feature request)

gamov opened this issue · comments

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!