Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git@github.com:rails/rails

  • Loading branch information...
commit 7c73518ef7cc49a4bee317e89c850b87ea1dea93 2 parents 0be5bc3 + a7f920f
@jeremy jeremy authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activerecord/lib/active_record/calculations.rb
View
2  activerecord/lib/active_record/calculations.rb
@@ -286,7 +286,7 @@ def type_cast_calculated_value(value, column, operation = nil)
case operation
when 'count' then value.to_i
when 'sum' then type_cast_using_column(value || '0', column)
- when 'avg' then value && value.to_d
+ when 'avg' then value && value.to_f.to_d
else type_cast_using_column(value, column)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.