I should add -- I'm not trying to persist the value to the db -- just setting it in the model instance.
2009/5/11 doug livesey <[email protected]> > I'm (almost) certian that it never used to do that. > I'm sure I've specced validates_numericality_of with integer fields before > in the same way I tried here, and the model instance stored the value > "12.34" as an instance variable. > Naturally, it wouldn't have saved, but it would keep the erroneous value so > that I could redisplay it in the form with error messages to the user. > Having it transparently truncate the input is rather a bad idea, I would > have thought, as later there is no warning that that is what is happening, > and the user might later rely on a value they thought they'd entered & saved > without issue. > It's not the end of the world -- I just changed the field to a string -- > but I thought it odd & worth mentioning. > Cheers, > Doug. > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "NWRUG" 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/nwrug-members?hl=en -~----------~----~----~----~------~----~------~--~---
