Permalink
Browse files

Use present rather than any

  • Loading branch information...
1 parent f95fcdd commit ea7b5ff99e44aac0fc643e02dc4d046ab99ecdc7 @jeremy jeremy committed Dec 28, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/relation.rb
View
4 activerecord/lib/active_record/relation.rb
@@ -25,7 +25,7 @@ def merge(r)
select(r.send(:select_clauses).join(', ')).
eager_load(r.eager_load_associations).
preload(r.associations_to_preload).
- from(r.send(:sources).any? ? r.send(:from_clauses) : nil)
+ from(r.send(:sources).present? ? r.send(:from_clauses) : nil)
end
alias :& :merge
@@ -158,7 +158,7 @@ def to_a
:conditions => where_clause,
:limit => @relation.taken,
:offset => @relation.skipped,
- :from => (@relation.send(:from_clauses) if @relation.send(:sources).any?)
+ :from => (@relation.send(:from_clauses) if @relation.send(:sources).present?)
},
ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, @eager_load_associations, nil))
end

0 comments on commit ea7b5ff

Please sign in to comment.