aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index b337606f84..6d6ae5e5c6 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -73,21 +73,13 @@ module ActiveRecord
def where(opts, *rest)
relation = clone
-
- if opts.present?
- relation.where_values += build_where(opts, rest)
- end
-
+ relation.where_values += build_where(opts, rest) unless opts.blank?
relation
end
def having(*args)
relation = clone
-
- if args.present?
- relation.having_values += build_where(*args)
- end
-
+ relation.having_values += build_where(*args) unless args.blank?
relation
end