Permalink
Browse files

Merge branch 'master' into testing

  • Loading branch information...
2 parents c0310bd + 7c73518 commit 661980692b8cb9986b9a94bcc52955e6142bd8b2 @jeremy jeremy committed Nov 8, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 6619806

Please sign in to comment.