File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -663,6 +663,9 @@ describe Interro do
663663 matching.none?.should eq false
664664 empty.any?.should eq false
665665 empty.none?.should eq true
666+ # Check whether we can do it on an empty QueryBuilder
667+ UserQuery .new.any?.should eq true
668+ UserQuery .new.none?.should eq false
666669 end
667670
668671 describe " transactions" do
Original file line number Diff line number Diff line change @@ -508,11 +508,15 @@ module Interro
508508 sql = String .build do |str |
509509 str << " SELECT 1 AS one"
510510 str << " FROM " << sql_table_name
511+
511512 if join = join_clause
512513 join.each(& .to_sql(str))
513514 end
514515
515- str << " WHERE " << @where_clause .try(& .to_sql)
516+ if where = where_clause
517+ str << " WHERE " << where.to_sql
518+ end
519+
516520 str << " LIMIT 1"
517521 end
518522
You can’t perform that action at this time.
0 commit comments