diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-06-21 22:54:14 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-06-21 22:54:18 -0300 |
commit | 4bbd35f7a6c495959ffa2d08a88302f34b9a2531 (patch) | |
tree | 13ed27ea6d4812ba6cfc91ea681911e4cddebca3 /activerecord | |
parent | a4cc79d0614ee334f4885309c22f1a56942de3f0 (diff) | |
download | rails-4bbd35f7a6c495959ffa2d08a88302f34b9a2531.tar.gz rails-4bbd35f7a6c495959ffa2d08a88302f34b9a2531.tar.bz2 rails-4bbd35f7a6c495959ffa2d08a88302f34b9a2531.zip |
Set the hash value directly instead of using merge!
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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) |