Permalink
Browse files

Ruby 1.9 compat: calculations don't assume array implementation of or…

…dered hash. References #1689 [Frederick Cheung]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 5162e31 commit 57c613a6013b351c41a74f986edfbb8bab12691b @jeremy jeremy committed Dec 27, 2007
Showing with 2 additions and 1 deletion.
  1. +2 −1 activerecord/lib/active_record/calculations.rb
@@ -230,7 +230,8 @@ def execute_grouped_calculation(operation, column_name, column, options) #:nodoc
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

0 comments on commit 57c613a

Please sign in to comment.