lib/sakuramochi/relation.rb in sakuramochi-0.5.2 vs lib/sakuramochi/relation.rb in sakuramochi-0.5.3

- old
+ new

@@ -44,11 +44,15 @@ Arel::Nodes::Grouping.new(expression) if expression end end def build_where_with_condition(opts, other = []) - ast = Sakuramochi::Condition::Parser.new(opts.dup).parse - [collapse_conditions(ast, other)].compact + if Sakuramochi::Condition.condition?(opts) + ast = Sakuramochi::Condition::Parser.new(opts.dup).parse + [collapse_conditions(ast, other)].compact + else + build_where_without_condition(opts, other) + end end end end end