From 57c613a6013b351c41a74f986edfbb8bab12691b Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 27 Dec 2007 11:18:30 +0000 Subject: 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 --- activerecord/lib/active_record/calculations.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/calculations.rb') 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 -- cgit v1.2.3