heartcombo / devise

Flexible authentication solution for Rails with Warden.
http://blog.plataformatec.com.br/tag/devise/
MIT License
23.95k stars 5.55k forks source link

Resend confirmation instructions triggering error #5660

Closed tbrammar closed 9 months ago

tbrammar commented 10 months ago

Environment

Current behavior

When a user attempts to resend their confirmation instructions using the Resend confirmation instructions form we receive an error:

Started POST "/u/confirmation" for 127.0.0.1 at 2023-12-08 16:58:01 +0100
Processing by Users::ConfirmationsController#create as HTML
  Parameters: {"authenticity_token"=>"[FILTERED]", "user"=>{"email"=>"test@example.com"}, "commit"=>"Resend confirmation instructions"}
Completed 500 Internal Server Error in 6ms (ActiveRecord: 0.0ms | Allocations: 996)
ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR:  column users.unconfirmed_email_with_errors does not exist
LINE 1: SELECT "users".* FROM "users" WHERE "users"."unconfirmed_ema...                                            ^
):

It seems like this method is not being called and the find_by_unconfirmed_email_with_errors method is being interpreted by Rails as a normal Active Record find_... method.

Expected behavior

A user should be able to resend their confirmation instructions without receiving an error.

tbrammar commented 9 months ago

Bah - my bad. I had monkey patched the method in my own code and that was throwing the error.