Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Changeset [f4f4964ce0a05cac38bbff3b308ac558228bad29] by Raimonds Simanovskis

Revision f4f4964ce0a05cac38bbff3b308ac558228bad29, committed by Raimonds Simanovskis · January 10th, 2011 @ 11:51 PM

Always return decimal average of integer fields

In previous version if database adapter (e.g. SQLite and Oracle) returned non-String calculated values then type_cast_using_column converted decimal average value of intefer field to integer value. Now operation parameter is always checked to decide which conversion of calculated value should be done.
https://github.com/rails/rails/commit/f4f4964ce0a05cac38bbff3b308ac...

2 changed files

  • M activerecord/lib/active_record/relation/calculations.rb
  • M activerecord/test/cases/calculations_test.rb