Skip to content
Browse files

eliminate present? for fewer method calls

  • Loading branch information...
1 parent 662ce52 commit 378728b5d1815dc03627050849ec4e46d606fcda @tenderlove tenderlove committed Sep 8, 2010
Showing with 2 additions and 10 deletions.
  1. +2 −10 activerecord/lib/active_record/relation/query_methods.rb
View
12 activerecord/lib/active_record/relation/query_methods.rb
@@ -73,21 +73,13 @@ def joins(*args)
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

0 comments on commit 378728b

Please sign in to comment.
Something went wrong with that request. Please try again.