From ea7b5ff99e44aac0fc643e02dc4d046ab99ecdc7 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 28 Dec 2009 12:12:53 -0800 Subject: [PATCH] Use present rather than any --- activerecord/lib/active_record/relation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index c7a74b7763..cb743358b2 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -25,7 +25,7 @@ module ActiveRecord 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 @@ module ActiveRecord :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