Tiago Fernandes
Not a member
Tiago Fernandes's latest activity
Sunday, December 19 2010
6103
average() returns integer values instead of decimals
was updated
in Ruby on Rails
-
Tiago Fernandes commented at 11:53 PM# Casts value (which is a String) to an appropriate instance. def type_cast(value) return nil if value.nil? puts "Class: #{type.clas... -
Tiago Fernandes commented at 11:52 PMThink that the bug is related with type_cast method in the schema_definitions.rb
If you create a second field rating2 of type float, and test Post.average(:rati...
-
Tiago Fernandes commented at 1:11 AMDid a quick test with a fresh rails install and sqlite3, and the calculated value is different for columns of type integer and float.
-
Tiago Fernandes commented at 1:10 AMThink this bug is related with the type cast of the calculated value. the activerecord tries to cast the value based on the type of the column.
If the rating co...