Code Monkey home page Code Monkey logo

Comments (6)

swrobel avatar swrobel commented on May 25, 2024

@allenwq to clarify, when doing the following:

user.update(email: '[email protected]')
user.errors.full_messages.first
=> "Email is invalid"

But when updating the email directly, you get the following:

email.update(email: '[email protected]')
email.errors.full_messages.first
=> "Email has already been taken"

from devise-multi_email.

allenwq avatar allenwq commented on May 25, 2024

@swrobel Yes, I get it, this is a rails behaviour. we can fix it by propagating the email errors one level up. but i am not sure if we should leave the application to handle it... let me think.

from devise-multi_email.

swrobel avatar swrobel commented on May 25, 2024

@allenwq @ArthurWD does this do anything to fix this issue? #24

from devise-multi_email.

ArthurWD avatar ArthurWD commented on May 25, 2024

Seems to me like this issue is indeed fixed by #24.

I get this result:

user.update(email: '[email protected]')
user.errors.full_messages.first
=> "Email has already been taken"

from devise-multi_email.

allenwq avatar allenwq commented on May 25, 2024

@ArthurWD wow, I didn't expect that.

@jeremylynch Can verify if this is still an issue?

from devise-multi_email.

swrobel avatar swrobel commented on May 25, 2024

@ArthurWD that's odd, I can't seem to replicate that behavior. I still get Email is invalid with latest master & Rails 5.2.0

Update: I'm able to get the same behavior that @ArthurWD sees by adding autosave: true to my emails association, ex:

has_many :emails, autosave: true

This doesn't require using the latest w/ ArthurWD's change merged.

from devise-multi_email.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.