• Magdalena Frankiewicz's avatar
    Add primary email to emails even when skip_reconfirmation! called · dfa29da9
    Magdalena Frankiewicz authored
    Previously, in cases when skip_reconfirmation! was called before
    updating the primary email, the email (which is to be considered
    confirmed) would not be added to the emails table, because
    `User#confirm` was not called.
    
    Now instead of overriding `User#confirm` we use an `after_save` callback
    that checks if the primary email changed and if it is confirmed, and if
    so adds it to the emails. This works also in case skip_reconfirmation is
    called, and is also cleaner than overriding a Devise method.
    dfa29da9
user_spec.rb 211 KB