-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let an app load ActionMailer/ActionView (#56)
* Let an app load ActionMailer/ActionView Requiring ActionMailer while the gem is loading might break initialization logic of a Rails app using Rails 6.0 or later. ActionMailer 6.0 introduces the new `delivery_job` setting (https://github.com/rails/rails/blob/6-0-stable/actionmailer/lib/action_mailer/railtie.rb#L49-L51) whose value is being constantized and applied as soon as ActionMailer is loaded. Normally, the delivery job would be configured during the app initialization, so if ActionMailer is loaded **before** the initializer is being executed, the configuration won’t be applied and a default `delivery_job` class would be used. The problem here is that Maildown is required before Rails initializers run, and it forces loading of ActionMailer by requiring `ActionMailer::Base` for monkey-patching. This causes ActionMailer to never apply `delivery_job` config. The solution seems simple enough: delay monkey-patching until ActionMailer is loaded. Because it's easy and seems safer, we'll also delay monkey-patching of ActionView until it's loaded as well. * Update CHANGELOG * Bump up verssions in Gemfiles Fix the CI build.
- Loading branch information
Showing
9 changed files
with
20 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters