Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Open
powertoaster opened this Issue Oct 5, 2010 · 1 comment

Comments

Projects
None yet
1 participant

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)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment