diff options
author | Joshua Peek <josh@joshpeek.com> | 2012-10-15 10:20:50 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2012-10-15 10:20:50 -0500 |
commit | c800e27ad35ec46f32b5ac4428e5cf7141f95105 (patch) | |
tree | 0821e0afaba2a74dec6ea1397ee3cabfd3d10c59 /railties/lib/rails/application/finisher.rb | |
parent | 7dba1599d9092a8362956a3fab23b2c60eedea63 (diff) | |
parent | 46dc6e7786222865309d15a9eaaaf55e3b7d9c1f (diff) | |
download | rails-c800e27ad35ec46f32b5ac4428e5cf7141f95105.tar.gz rails-c800e27ad35ec46f32b5ac4428e5cf7141f95105.tar.bz2 rails-c800e27ad35ec46f32b5ac4428e5cf7141f95105.zip |
Merge branch 'master' into asset-path-helper
Conflicts:
railties/test/application/configuration_test.rb
Diffstat (limited to 'railties/lib/rails/application/finisher.rb')
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index d2a402aa51..c520f7af9d 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -72,7 +72,7 @@ module Rails # Set app reload just after the finisher hook to ensure # paths added in the hook are still loaded. - initializer :set_clear_dependencies_hook, :group => :all do + initializer :set_clear_dependencies_hook, group: :all do callback = lambda do ActiveSupport::DescendantsTracker.clear ActiveSupport::Dependencies.clear @@ -83,7 +83,7 @@ module Rails self.reloaders << reloader # We need to set a to_prepare callback regardless of the reloader result, i.e. # models should be reloaded if any of the reloaders (i18n, routes) were updated. - ActionDispatch::Reloader.to_prepare(:prepend => true){ reloader.execute } + ActionDispatch::Reloader.to_prepare(prepend: true){ reloader.execute } else ActionDispatch::Reloader.to_cleanup(&callback) end @@ -97,8 +97,9 @@ module Rails end initializer :activate_queue_consumer do |app| - if config.queue == ActiveSupport::Queue - app.queue_consumer = config.queue_consumer.start(app.queue, {logger: Rails.logger}) + if config.queue.class == ActiveSupport::Queue + app.queue_consumer = config.queue_consumer || config.queue.consumer + app.queue_consumer.start at_exit { app.queue_consumer.shutdown } end end |