aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/lib/rails/application.rb10
-rw-r--r--railties/lib/rails/application/configuration.rb3
-rw-r--r--railties/lib/rails/application/finisher.rb4
-rw-r--r--railties/lib/rails/engine.rb6
4 files changed, 10 insertions, 13 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 0b8eac8a8b..aa6608d49e 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -46,11 +46,11 @@ module Rails
# 5) Load config/environments/ENV.rb
# 6) Run config.before_initialize callbacks
# 7) Run Railtie#initializer defined by railties, engines and application.
- # One by one, each engine sets up its load paths, routes, locales and so on.
- # 8) Runs all registered config/initializers/*, executing the engines one first
- # 9) Build the middleware stack and run to_prepare callbacks
- # 10) Run config.before_eager_load and eager_load if cache classes is true
- # 11) Run config.after_initialize callbacks
+ # One by one, each engine sets up its load paths, routes and runs its config/initializers/* files.
+ # 9) Custom Railtie#initializers added by railties, engines and applications are executed
+ # 10) Build the middleware stack and run to_prepare callbacks
+ # 11) Run config.before_eager_load and eager_load if cache classes is true
+ # 12) Run config.after_initialize callbacks
#
class Application < Engine
autoload :Bootstrap, 'rails/application/bootstrap'
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index 39d66ecc31..40deecea1c 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -8,7 +8,7 @@ module Rails
attr_accessor :allow_concurrency, :asset_host, :asset_path, :assets,
:cache_classes, :cache_store, :consider_all_requests_local,
:dependency_loading, :filter_parameters, :force_ssl, :helpers_paths,
- :initializers_paths, :logger, :log_tags, :preload_frameworks,
+ :logger, :log_tags, :preload_frameworks,
:railties_order, :relative_url_root, :reload_plugins, :secret_token,
:serve_static_assets, :ssl_options, :static_cache_control, :session_options,
:time_zone, :reload_classes_only_on_change, :whiny_nils
@@ -36,7 +36,6 @@ module Rails
@generators = app_generators
@cache_store = [ :file_store, "#{root}/tmp/cache/" ]
@railties_order = [:all]
- @initializers_paths = []
@relative_url_root = ENV["RAILS_RELATIVE_URL_ROOT"]
@reload_classes_only_on_change = true
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb
index e000f6ef3a..3a94311b57 100644
--- a/railties/lib/rails/application/finisher.rb
+++ b/railties/lib/rails/application/finisher.rb
@@ -4,10 +4,6 @@ module Rails
include Initializable
$rails_rake_task = nil
- initializer :load_config_initializers do
- config.initializers_paths.each { |init| load(init) }
- end
-
initializer :add_generator_templates do
config.generators.templates.unshift(*paths["lib/templates"].existent)
end
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index 86efc7332c..5c1af99fe2 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -583,8 +583,10 @@ module Rails
end
end
- initializer :append_config_initializers do |app|
- app.config.initializers_paths.concat config.paths["config/initializers"].existent.sort
+ initializer :load_config_initializers do
+ config.paths["config/initializers"].existent.sort.each do |initializer|
+ load(initializer)
+ end
end
initializer :engines_blank_point do