Lets say you’re going to do validates_uniqueness_of on a model’s e-mail
address attribute.
If the e-mail address already exists how do I tell the model to just do
an update instead of redirecting back to the new/create page indicating
that the address already exists? I see a callback called
after_validation but I’m just not sure how to use it; it indeed it is
the method to use.
thanks for your response. perhaps i’m thinking about the problem in the
wrong way then. the scenario is, if a visitor comes back to the site
and sign up for a different event, i want to check to see if he’s
already in the DB, and if he is i’ll just update his record instead of
creating a new one. but, perhaps that shoudl be done at the controller
level instead of the model?
binh
Keynan P. wrote:
oh and if validation fails the after_validation event will not fire