From 4bbd35f7a6c495959ffa2d08a88302f34b9a2531 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Thu, 21 Jun 2012 22:54:14 -0300 Subject: Set the hash value directly instead of using merge! --- activerecord/lib/active_record/associations/collection_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 2447914640..2f6ddfeeb3 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -186,7 +186,7 @@ module ActiveRecord if options[:uniq] # This is needed because 'SELECT count(DISTINCT *)..' is not valid SQL. column_name ||= reflection.klass.primary_key - count_options.merge!(:distinct => true) + count_options[:distinct] = true end value = scoped.count(column_name, count_options) -- cgit v1.2.3