diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-23 16:07:20 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-23 16:07:20 +0100 |
commit | 4f036032152518791d379f47260236f619713fbb (patch) | |
tree | 25e9c3dc1f865e221e2964adb7ec05a543632888 /railties/lib/rails/application/finisher.rb | |
parent | 80130d1201c3bf9dc17b0e1fcd81c6b22e893b0a (diff) | |
download | rails-4f036032152518791d379f47260236f619713fbb.tar.gz rails-4f036032152518791d379f47260236f619713fbb.tar.bz2 rails-4f036032152518791d379f47260236f619713fbb.zip |
Break application.rb file in smaller chunks.
Diffstat (limited to 'railties/lib/rails/application/finisher.rb')
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb new file mode 100644 index 0000000000..4e7fffd0b3 --- /dev/null +++ b/railties/lib/rails/application/finisher.rb @@ -0,0 +1,31 @@ +module Rails + class Application + module Finisher + include Initializable + + initializer :add_builtin_route do |app| + if Rails.env.development? + app.config.action_dispatch.route_files << File.join(RAILTIES_PATH, 'builtin', 'routes.rb') + end + end + + initializer :build_middleware_stack do |app| + app.app + end + + # Fires the user-supplied after_initialize block (config#after_initialize) + initializer :after_initialize do |app| + app.config.after_initialize_blocks.each do |block| + block.call(app) + end + end + + # Disable dependency loading during request cycle + initializer :disable_dependency_loading do |app| + if app.config.cache_classes && !app.config.dependency_loading + ActiveSupport::Dependencies.unhook! + end + end + end + end +end
\ No newline at end of file |