I am using Devise with :confirmable
option enabled. I am also using config.reconfirmable = true
and thus adding unconfirmed_email
column to my user model.
From here:
unconfirmed_email - An email address copied from the email attr. After confirmation this value is copied to the email attr then cleared
However, when I create and log a user I get nil
for the unconfirmed_email
attribute, even though I don't confirm. The email
field, on another hand, is not empty and contains the unconfirmed email.
When I log user object in my after_create
callback, I have unconfirmed_email: <email>
, email: nil
. Which means that initially the user object is created with unconfirmed_email
filled in, but then at some point (although before confirmation) moves to email
.
So the question is, at what pointdoes Devise copies unconfirmed_email
value to email
, and why is it doing so before the email is confirmed.