plataformatec/devise — pull request #2403 by ValMilkevich (2013-05-05 23:14:06+00:00)
Title: Allow to change email for already created user with blank email

Hi,

I have the following config:
#config/devise.rb
Devise.allow_unconfirmed_access_for = 30.days

#app/models/user.rb
def email_required?
(created_at || Time.now) < Devise.allow_unconfirmed_access_for.ago
end

Users are signing up through omniauth only, so I'm not asking for email address if they do not provide it. However when later on the user want's to change his email - the system won't allow him to do so, because of :postpone_email_change? and sends mail to the user ( to blank email address ), while sending mail is cool, I want it to go to the real email address and email address to be changed accordingly.

This logic only works if the user had blank email initially