Permalink
Browse files

Avoid calling build_where is no argument is given.

  • Loading branch information...
1 parent 87e50f1 commit c11eec84821b9f88d928be77a9ed636384f2e699 @miloops miloops committed Aug 31, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/query_methods.rb
View
2 activerecord/lib/active_record/relation/query_methods.rb
@@ -52,7 +52,7 @@ def joins(*args)
end
def where(opts, *rest)
- if value = build_where(opts, rest)
+ if opts.present? && value = build_where(opts, rest)
copy = clone
copy.where_values += Array.wrap(value)
copy

0 comments on commit c11eec8

Please sign in to comment.