Devise validatable and password_confirmation presence

Hi,

I was writing some tests when I discovered (god bless testing…) that
my
User model, that use Devise, doesn’t validate the presence of the
:password_confirmation field.

I was expecting that adding :validatable to the Devise option would
include
the presence validation for this field too.

Could any one please explain this behaviour?

There is a better solution than simply adding that field to User model
validation?

thank you.

bye,

enricostn

Can’t follow you all the confirmation-fields you probably have, don’t
need to be checked if they are present That’s throwing away CPU
cycles and therefore money!

It is simple logic:

When all validations pass on the original field they will also pass on
the corresponding confirmation field, as long as it has the same value
as the original field. So do all necessary validations on your
original field, check if it is identical with the confirmation field
and you are done

2012/9/28 enrico stano [email protected]:

Ok I got it. You’re probably right. The validation for the
confirmation field it’s related to the comparation with the original
field.

Thanks

2012/9/28 Norbert M. [email protected]:

and you are done


You received this message because you are subscribed to the Google G. “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 https://groups.google.com/groups/opt_out.


Enrico Stano

twitter @enricostano
skype ocirneonats