For the record...

On Jan 16, 4:17 pm, Adriano <adri...@peabirus.com.br> 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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to