Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy-load ActionMailer::Base to defer :action_mailer on_load hook #89

Merged
merged 1 commit into from
Feb 18, 2014
Merged

Lazy-load ActionMailer::Base to defer :action_mailer on_load hook #89

merged 1 commit into from
Feb 18, 2014

Conversation

amatsuda
Copy link
Contributor

Bundling current version of letter_opener immediately loads ActionMailer::Base when the gem is required, and thus triggers its whole initialization scripts (and then ActionMailer loads ActionView here) even in situations that ActionMailer or ActionView are not actually needed (e.g. booting up the Rails console, executing a model test, running a Rake task, etc.).

Here's a fix to lazy-load AM::Base via ActiveSupport.on_load hook so that AM::Base is loaded when actually referenced from the application.

nashby added a commit that referenced this pull request Feb 18, 2014
Lazy-load ActionMailer::Base to defer :action_mailer on_load hook
@nashby nashby merged commit 6c6e0c4 into ryanb:master Feb 18, 2014
@nashby
Copy link
Collaborator

nashby commented Feb 18, 2014

❤️ 💚 💙 💛 💜

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.

2 participants