Anne The objective of the exercise is to understand the ActiveRecord validations cycle, and use several of them to comply with all the listed requirements.
Don't worry about having to send back to the user the original format that he used, if the price of that is to have to resort to your own validation code and break what has been achieved. [Let alone that I am not sure that it would be wrong to present the credit card normalized with the message "credit card not unique"; but this is not the point]. In general, I would use each one of these exercises to learn well *one subject*, not to solve all the requirements of a real web site. Of course, this is just my opinion, Raul On Sun, Nov 2, 2008 at 6:19 PM, anne001 <[EMAIL PROTECTED]> wrote: > > Oups, that won't work. > > the data has to be in format xxxxx in order to be validated > but if uniqueness fails, it has to be in format xxxx-xxxx or whatever > the user put in. > > So even if I take care of formatting validation in before-validation > I have not resolved the problem. > > Seems to me this require defining our own validation rather than rely > on > call-backs etc. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ruby-on-rails-programming-with-passion" group. To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en -~----------~----~----~----~------~----~------~--~---
