Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 57c613a6013b351c41a74f986edfbb8bab12691b 1 parent 5162e31
Jeremy Kemper jeremy authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  activerecord/lib/active_record/calculations.rb
3  activerecord/lib/active_record/calculations.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.