Permalink
Browse files

refactor to use faster empty?

  • Loading branch information...
1 parent 7ddf663 commit 5297e641cd67c834bd4a63be3ea6c4e797f2751c @tenderlove tenderlove committed Sep 8, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/relation/query_methods.rb
@@ -12,8 +12,10 @@ module QueryMethods
def includes(*args)
args.reject! {|a| a.blank? }
+ return clone if args.empty?
+
relation = clone
- relation.includes_values = (relation.includes_values + args).flatten.uniq if args.present?
+ relation.includes_values = (relation.includes_values + args).flatten.uniq
relation
end

0 comments on commit 5297e64

Please sign in to comment.