This project is archived and is in readonly mode.

#1346 ✓resolved
Ken Collins

Coerce 0 Average Calculation To Float

Reported by Ken Collins | November 7th, 2008 @ 08:35 PM

Some databases return 0 for a #average calculation. For instance:

Topic.average(:replies_count)

Returns 0 from SQL Server and will bomb when #type_cast_calculated_value is run. I am submitting this patch with high hopes that it can be done in 2.2 release. We are trying to finish the new SQL Server adapter to that release and having all the tests pass would without monkey patching rails would be great!

Cheers.

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>

Attachments

Referenced by

Pages