diff options
Diffstat (limited to 'railties/lib/initializer.rb')
-rw-r--r-- | railties/lib/initializer.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index a3ab73fd51..b535c8624b 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -70,6 +70,8 @@ module Rails # * #load_plugins # * #load_observers # * #initialize_routing + # * #after_initialize + # * #load_application_initializers # # (Note that #load_environment is invoked twice, once at the start and # once at the end, to support the legacy configuration style where the @@ -112,6 +114,8 @@ module Rails # the framework is now fully initialized after_initialize + + load_application_initializers end # Check for valid Ruby version @@ -334,6 +338,12 @@ module Rails configuration.after_initialize_block.call if configuration.after_initialize_block end + def load_application_initializers + Dir["#{RAILS_ROOT}/config/initializers/**/*.rb"].each do |initializer| + load(initializer) + end + end + protected # Return a list of plugin paths within base_path. A plugin path is # a directory that contains either a lib directory or an init.rb file. |