L
larry
I have a ruby class called Duration that represents a unit of time.
It's main attribute is a number that represents the duration in
seconds.
If I try to save it to a DB using Rails, I get a "Duration can not be
coerced into Float" error. Is there a way to modify the definition of
Duration to enable automatic coercion into a float? (I'm thinking of
something like adding a "to_float" method to the class.)
thanks in advance
larry
It's main attribute is a number that represents the duration in
seconds.
If I try to save it to a DB using Rails, I get a "Duration can not be
coerced into Float" error. Is there a way to modify the definition of
Duration to enable automatic coercion into a float? (I'm thinking of
something like adding a "to_float" method to the class.)
thanks in advance
larry