Created
May 6, 2018 06:51
-
-
Save sj26/e061f7c08576dae36fe162d0ca2866dc to your computer and use it in GitHub Desktop.
rails/rails#32808 — demonstrate that mail is not eager loaded correctly during application initialization
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
gem "railties", "5.2.0" | |
gem "actionmailer", "5.2.0" | |
require "rails/application" | |
require "action_mailer/railtie" | |
class Application < Rails::Application | |
config.eager_load = true | |
end | |
$LOADED_FEATURES.size | |
# => 440 | |
Application.initialize! | |
$LOADED_FEATURES.size | |
# => 887 | |
Mail.autoload? :ContentTypeElement | |
# => "mail/elements/content_type_element" # i.e. true | |
$LOADED_FEATURES.grep /content_type_element/ | |
# => [] # empty, so mail/elements/content_type_element is not loaded | |
Mail::ContentTypeElement | |
Mail.autoload? :ContentTypeElement | |
# => nil # i.e. false | |
$LOADED_FEATURES.size | |
# => 901 | |
$LOADED_FEATURES.grep /content_type_element/ | |
# => [".../mail-2.7.0/lib/mail/elements/content_type_element.rb"] | |
Mail.eager_autoload! | |
$LOADED_FEATURES.size | |
# => 921 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment