mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Move reloader middleware in ActionDispatch
This commit is contained in:
parent
1d2686517c
commit
d7396b5ca9
4 changed files with 6 additions and 6 deletions
|
@ -57,7 +57,6 @@ module ActionController
|
|||
autoload :PolymorphicRoutes, 'action_controller/routing/generation/polymorphic_routes'
|
||||
autoload :RecordIdentifier, 'action_controller/record_identifier'
|
||||
autoload :Redirector, 'action_controller/base/redirect'
|
||||
autoload :Reloader, 'action_controller/reloader'
|
||||
autoload :Renderer, 'action_controller/base/render'
|
||||
autoload :RequestForgeryProtection, 'action_controller/base/request_forgery_protection'
|
||||
autoload :Rescue, 'action_controller/dispatch/rescue'
|
||||
|
|
|
@ -5,8 +5,8 @@ module ActionController
|
|||
class << self
|
||||
def define_dispatcher_callbacks(cache_classes)
|
||||
unless cache_classes
|
||||
unless self.middleware.include?(Reloader)
|
||||
self.middleware.insert_after(ActionDispatch::Failsafe, Reloader)
|
||||
unless self.middleware.include?(ActionDispatch::Reloader)
|
||||
self.middleware.insert_after(ActionDispatch::Failsafe, ActionDispatch::Reloader)
|
||||
end
|
||||
|
||||
ActionView::Helpers::AssetTagHelper.cache_asset_timestamps = false
|
||||
|
|
|
@ -46,6 +46,7 @@ module ActionDispatch
|
|||
|
||||
autoload :Failsafe, 'action_dispatch/middleware/failsafe'
|
||||
autoload :ParamsParser, 'action_dispatch/middleware/params_parser'
|
||||
autoload :Reloader, 'action_dispatch/middleware/reloader'
|
||||
autoload :RewindableInput, 'action_dispatch/middleware/rewindable_input'
|
||||
autoload :MiddlewareStack, 'action_dispatch/middleware/stack'
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
module ActionController
|
||||
module ActionDispatch
|
||||
class Reloader
|
||||
def initialize(app)
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
Dispatcher.reload_application
|
||||
ActionController::Dispatcher.reload_application
|
||||
@app.call(env)
|
||||
ensure
|
||||
Dispatcher.cleanup_application
|
||||
ActionController::Dispatcher.cleanup_application
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue