For the record... On Jan 16, 4:17 pm, Adriano <[email protected]> wrote: > TypeError: wrong argument type String (expected Fixnum)
[snip] > def initialize(string) > @value = BigDecimal(string.sub(/,/, '.')) > end The problem was that value object can be initialized with a string (from the form) or with a number (from the db). Thus initialize should be changed, eg: def initialize(value) @value = BigDecimal(value.to_s(/,/, '.')) end -- Adriano --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

