class ActionDispatch::Reloader


or ActionDispatch::Reloader.cleanup! are called manually.
middleware stack, but are executed only when ActionDispatch::Reloader.prepare!
is false. Callbacks may be registered even when it is not included in the
only in the development environment; specifically, when config.cache_classes
By default, ActionDispatch::Reloader is included in the middleware stack
classes before they are unloaded.
is evaluated, ensuring that it can refer to application models and other
Cleanup callbacks will not be called until after the response_body lambda
end
# code here which refers to application models
self.response_body = -> (response, output) do
following:
the response body. This is important for streaming responses such as the
request is fully complete – that is, after #close has been called on
before and after callbacks. However, cleanup callbacks are not called until the
after each request. In this respect they are analogs of ActionDispatch::Callback’s
Prepare callbacks are run before each request, and cleanup callbacks
intended to assist with code reloading during development.
ActionDispatch::Reloader provides prepare and cleanup callbacks,

def self.cleanup!

def self.cleanup!
  default_reloader.reload!
end

def self.prepare!

def self.prepare!
  default_reloader.prepare!
end

def self.to_cleanup(*args, &block)

def self.to_cleanup(*args, &block)
  ActiveSupport::Reloader.to_complete(*args, &block)
end

def self.to_prepare(*args, &block)

def self.to_prepare(*args, &block)
  ActiveSupport::Reloader.to_prepare(*args, &block)
end