aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_through_association.rb
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2008-08-28 14:01:42 -0400
committerJeremy Kemper <jeremy@bitsweat.net>2008-08-28 11:58:25 -0700
commit44af2efa2c7391681968c827ca47201a0a02e974 (patch)
treea25ede2a88799c281468fcdaa4321d6048cee240 /activerecord/lib/active_record/associations/has_many_through_association.rb
parentce4d13861dc54a1ac7fbe411327b9a2427f95366 (diff)
downloadrails-44af2efa2c7391681968c827ca47201a0a02e974.tar.gz
rails-44af2efa2c7391681968c827ca47201a0a02e974.tar.bz2
rails-44af2efa2c7391681968c827ca47201a0a02e974.zip
Refactored AssociationCollection#count for uniformity and Ruby 1.8.7 support.
[#831 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/lib/active_record/associations/has_many_through_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_many_through_association.rb10
1 files changed, 0 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb
index 24b02efc35..84fa900f46 100644
--- a/activerecord/lib/active_record/associations/has_many_through_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -31,16 +31,6 @@ module ActiveRecord
return count
end
- def count(*args)
- column_name, options = @reflection.klass.send(:construct_count_options_from_args, *args)
- if @reflection.options[:uniq]
- # This is needed because 'SELECT count(DISTINCT *)..' is not valid SQL statement.
- column_name = "#{@reflection.quoted_table_name}.#{@reflection.klass.primary_key}" if column_name == :all
- options.merge!(:distinct => true)
- end
- @reflection.klass.send(:with_scope, construct_scope) { @reflection.klass.count(column_name, options) }
- end
-
protected
def construct_find_options!(options)
options[:select] = construct_select(options[:select])