mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-08 22:37:57 -05:00
Merge pull request #5731 from heartcombo/fix-without-mailer-load
Fix Zeitwerk autoloading when ActionMailer is not present.
This commit is contained in:
@@ -19,5 +19,8 @@
|
||||
* Add Rails 8 support.
|
||||
- Routes are lazy-loaded by default in test and development environments now so Devise loads them before `Devise.mappings` call.
|
||||
|
||||
* bug fixes
|
||||
* Make `Devise` work without `ActionMailer` when `Zeitwerk` autoloader is used.
|
||||
|
||||
Please check [4-stable](https://github.com/heartcombo/devise/blob/4-stable/CHANGELOG.md)
|
||||
for previous changes.
|
||||
|
||||
@@ -47,5 +47,11 @@ module Devise
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
initializer "devise.configure_zeitwerk" do
|
||||
if Rails.autoloaders.zeitwerk_enabled? && !defined?(ActionMailer)
|
||||
Rails.autoloaders.main.ignore("#{root}/app/mailers/devise/mailer.rb")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user