rails/rails — pull request #13308 by acapilleri (2013-12-13 16:06:25+00:00)
Title: fix unexpected truncation in ActiveRecord::Calculations

This PR fixes a wrong conversion to column_type in
`ActiveRecord::Calculations#calculation`
when the calculation has complex fields and the result
is a different type than the column.

This prevent truncation of result and allows the user
to have the original data type of result

Before:

Account.sum("2.1 * accounts.credit_limit") => 667

After:

Account.sum("2.1 * accounts.credit_limit") => 667.8

Fixes #12937