New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Email can't be blank" even though unconfirmed_email is present #2841

Closed
mahemoff opened this Issue Jan 22, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@mahemoff

mahemoff commented Jan 22, 2014

After updating to latest Devise (3.2.2 from v2), I am able to create a user record by specifying name, email, and password, but unable to save it due to {:email=>["can't be blank"]} error even though unconfirmed_email is set. Is there a way to make it pass validation if either email or unconfirmed email is set? I think that's what it did previously.

I have these properties for user model:

devise :database_authenticatable, :registerable, :recoverable,
       :rememberable, :trackable, :omniauthable, :validatable,
       :confirmable, :timeoutable
@mahemoff

This comment has been minimized.

mahemoff commented Jan 22, 2014

Just to add I've worked around this using:

def email_required?
  unconfirmed_email.blank?
end

Still, there must be a proper way to do it.

@josevalim

This comment has been minimized.

Member

josevalim commented Jan 22, 2014

You need to give us more information on how to reproduce this issue, otherwise there is nothing we can do. Please read CONTRIBUTING.md file for more information about creating bug reports. Thanks!

@josevalim josevalim closed this Jan 22, 2014

@edbond

This comment has been minimized.

edbond commented Feb 19, 2014

I have the same issue,
devise (2.1.4)

Getting :email=>["can't be blank"] with unconfirmed email set.

@edbond

This comment has been minimized.

edbond commented Feb 19, 2014

It happens when I try to update_attributes! in after_create callback

@edbond

This comment has been minimized.

edbond commented Feb 19, 2014

solved by moving logic from after_create callback to controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment