diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-12-29 04:28:43 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-12-29 04:30:04 +0530 |
commit | 08633bae5e4f05e913ec5d5d2483bfd6c07c7375 (patch) | |
tree | 9ceafedbf6825b2b756dabc34a4e297df4971741 /activerecord/lib/active_record/associations/association_collection.rb | |
parent | 949c8c0d0e92e6e7855dc4decc10eb4c658e0ede (diff) | |
download | rails-08633bae5e4f05e913ec5d5d2483bfd6c07c7375.tar.gz rails-08633bae5e4f05e913ec5d5d2483bfd6c07c7375.tar.bz2 rails-08633bae5e4f05e913ec5d5d2483bfd6c07c7375.zip |
Migrate all the calculation methods to Relation
Diffstat (limited to 'activerecord/lib/active_record/associations/association_collection.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 56b2a90138..b2b3a9789c 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -177,7 +177,7 @@ module ActiveRecord if @reflection.options[:counter_sql] @reflection.klass.count_by_sql(@counter_sql) else - column_name, options = @reflection.klass.send(:construct_count_options_from_args, *args) + column_name, options = @reflection.klass.scoped.send(:construct_count_options_from_args, *args) if @reflection.options[:uniq] # This is needed because 'SELECT count(DISTINCT *)..' is not valid SQL. column_name = "#{@reflection.quoted_table_name}.#{@reflection.klass.primary_key}" if column_name == :all |