Colin Law wrote: > On 16 June 2010 11:34, Stanislav Orlenko <[email protected]> wrote: >> � � �errors.add_to_base("Error message") unless cost.is_a?(Fixnum) >> >> when I enter 'asdf': >> >> ### 0: Fixnum >> >> I completely can't understand what happen. In migration: >> >> t.integer :cost >> >> I think ActiveRectord converts value to Fixnum because in migration this >> field signed as integer > > How is the string you enter getting into the cost attribute? > > Colin
I can't understand why cost field value (10, 10.1 or 'asdf') all time is Fixnum in model. In this model I try to validate cost, and can't because all time I get only one type - Fixnum! -- Posted via http://www.ruby-forum.com/. -- 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.

