aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-08 16:56:13 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-08 16:56:13 -0700
commit03377c755fdc7619fb62b82f1ea823519b1b78d7 (patch)
treec59900bc18147f85cc7638d464d216441da0ee9e
parentb4fdfcf6ad4ed7a98eb27a5c416c460a805c1355 (diff)
downloadrails-03377c755fdc7619fb62b82f1ea823519b1b78d7.tar.gz
rails-03377c755fdc7619fb62b82f1ea823519b1b78d7.tar.bz2
rails-03377c755fdc7619fb62b82f1ea823519b1b78d7.zip
eliminate present? for fewer method calls
-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