I have a user model with an e-mail field. When a user registers for the
site, I want them to confirm their email address by typing it in again.
If they change their email address, I want them to confirm their email
address by typing it in again. However, the user might change things on
their account not related to their email address, such as their phone
number, and they should not have to confirm their email address.
I suppose I can add an email_confirmation field to the database, and
But, this seems rather wasteful and silly to store both the email and
the email_confirmation. I understand that the model need not store the
field in the database, but then in that case User.find(:first) …
fiddle with attributes other than email address … User.save (rightly)
throws an error because the email_confirmation field doesn’t match
What is the proper way to model a phony email_confirmation field, such
that confirmation validation is only fired when the e-mail address is