Skip to content
Browse files

switch to blank? to avoid method calls

  • Loading branch information...
1 parent 5297e64 commit 16cff17e535abe93fe60bbfdaf476f5f23770b30 @tenderlove tenderlove committed Sep 8, 2010
Showing with 6 additions and 6 deletions.
  1. +6 −6 activerecord/lib/active_record/relation/query_methods.rb
View
12 activerecord/lib/active_record/relation/query_methods.rb
@@ -21,13 +21,13 @@ def includes(*args)
def eager_load(*args)
relation = clone
- relation.eager_load_values += args if args.present?
+ relation.eager_load_values += args unless args.blank?
relation
end
def preload(*args)
relation = clone
- relation.preload_values += args if args.present?
+ relation.preload_values += args unless args.blank?
relation
end
@@ -43,19 +43,19 @@ def select(value = Proc.new)
def group(*args)
relation = clone
- relation.group_values += args.flatten if args.present?
+ relation.group_values += args.flatten unless args.blank?
relation
end
def order(*args)
relation = clone
- relation.order_values += args.flatten if args.present?
+ relation.order_values += args.flatten unless args.blank?
relation
end
def reorder(*args)
relation = clone
- if args.present?
+ unless args.blank?
relation.order_values = args
relation.reorder_flag = true
end
@@ -285,7 +285,7 @@ def build_select(arel, selects)
def apply_modules(modules)
values = Array.wrap(modules)
- @extensions += values if values.present?
+ @extensions += values unless values.blank?
values.each {|extension| extend(extension) }
end

0 comments on commit 16cff17

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