Skip to content

Fix uninitialized constant CustomDeviseMailer on new org user invite (Resolves #5745) - #5762

Merged
dorner merged 2 commits into
rubyforgood:mainfrom
apostergiakis:5745-fix-custom-devise-mailer-load
Nov 16, 2026
Merged

dorner merged 2 commits into
rubyforgood:mainfrom
apostergiakis:5745-fix-custom-devise-mailer-load

Conversation

@apostergiakis

Copy link
Copy Markdown
Contributor

Resolves #5745

Description

Bumps devise_invitable 2.0.13 → 2.0.14, as agreed in the issue.

2.0.13 resolves Devise.mailer in an on_load(:action_mailer) hook. Without eager loading (e.g. development), that hook can fire while CustomDeviseMailer is still loading, which raises uninitialized constant CustomDeviseMailer. 2.0.14 contains only the upstream fix (scambra/devise_invitable#929).

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added spec/lib/custom_devise_mailer_load_spec.rb, which boots a fresh non-eager-loaded process, since CI eager-loads and hides the bug. It fails on 2.0.13 and passes on 2.0.14. Related mailer, invite and admin specs pass locally.

… a cold-loaded process (rubyforgood#5745)

Bump devise_invitable 2.0.13 -> 2.0.14. 2.0.13's :action_mailer load
hook resolved Devise.mailer while CustomDeviseMailer was still being
autoloaded, so the first invite in a non-eager-loaded process failed.
2.0.14 (scambra/devise_invitable#929) contains only that fix.

Adds a spec that boots a fresh non-eager-loaded process, since CI
eager-loads and hides the failure.

Resolves rubyforgood#5745

@dorner dorner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is good to demonstrate the fix, but IMO it doesn't need to be added to the corpus, especially since this was fixed in a dependency bump. We can stick with the bump and leave the test out.

The dependency bump fixes the issue; the spec was only needed to
demonstrate it.
@apostergiakis

Copy link
Copy Markdown
Contributor Author

@dorner Removed the spec, so this is just the devise_invitable bump now. Ready for another look.

@apostergiakis
apostergiakis requested a review from dorner November 16, 2026 10:40
@dorner
dorner merged commit 9ea9c84 into rubyforgood:main Nov 16, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: New User add for New Org page fails with error

2 participants