aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-27 11:18:30 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-27 11:18:30 +0000
commit57c613a6013b351c41a74f986edfbb8bab12691b (patch)
tree1648848889834dd6651570982520287547baab0e /activerecord
parent5162e31e5b8cedde6424e6c60d72dc83ff3ce423 (diff)
downloadrails-57c613a6013b351c41a74f986edfbb8bab12691b.tar.gz
rails-57c613a6013b351c41a74f986edfbb8bab12691b.tar.bz2
rails-57c613a6013b351c41a74f986edfbb8bab12691b.zip
Ruby 1.9 compat: calculations don't assume array implementation of ordered hash. References #1689 [Frederick Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/calculations.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb
index e08520f15f..e14700f93b 100644
--- a/activerecord/lib/active_record/calculations.rb
+++ b/activerecord/lib/active_record/calculations.rb
@@ -230,7 +230,8 @@ module ActiveRecord
key = type_cast_calculated_value(row[group_alias], group_column)
key = key_records[key] if associated
value = row[aggregate_alias]
- all << [key, type_cast_calculated_value(value, column, operation)]
+ all[key] = type_cast_calculated_value(value, column, operation)
+ all
end
end