This project is archived and is in readonly mode.

#4514 ✓committed
Brian Lopez

[PATCH] Check and immediately return value from an average if it's already a BigDecimal

Reported by Brian Lopez | April 30th, 2010 @ 11:05 PM | in 3.0.2

The return value from an average calculation is assumed to respond to #to_d but the value may already be a BigDecimal to start with. This patch adds a check for that case and returns the value as-is.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>