binarylogic / searchlogic

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

multiple values for a block parameter (0 for 1) #130

Open powertoaster opened 13 years ago

powertoaster commented 13 years ago

I do not understand why I m getting this message. The query is built and executed properly.

Is there a way to prevent this warning?

Here is my query. self.timesheets.tsdate_gte(period['begin']).tsdate_lte(period['end']).breakfast_eq_or_lunch_eq_or_dinner_eq(true).ascend_by_tsdate

Here is the resulting SQL which is exactly what I want. SELECT * FROM "timesheets" WHERE (((timesheets.breakfast = 't') OR (timesheets.lunch = 't') OR (timesheets.dinner = 't')) AND ((timesheets.tsdate <= '2010-10-09 23:59:59') AND ((timesheets.tsdate >= '2010-09-26 00:00:00') AND ("timesheets".employee_id = 1012120475)))) ORDER BY timesheets.tsdate ASC

Here is the warning message and locations I get.

RubymineProjects/newtime/vendor/gems/searchlogic-2.4.25/lib/searchlogic/named_scopes/conditions.rb:172 RubymineProjects/newtime/vendor/gems/searchlogic-2.4.25/lib/searchlogic/named_scopes/conditions.rb:110: warning: multiple values for a block parameter (0 for 1)

powertoaster commented 13 years ago

It did not wrap my query, so here it is on two lines. self.timesheets.tsdate_gte(period['begin']).tsdate_lte(period['end']). breakfast_eq_or_lunch_eq_or_dinner_eq(true).ascend_by_tsdate