Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module ActionDispatch
class Reloader
def call(env)
if env['PATH_INFO'].include?(Rails.application.config.assets.prefix)
@app.call(env)
else
@validated = @condition.call
prepare!
response = @app.call(env)
response[2] = ::Rack::BodyProxy.new(response[2]) { cleanup! }
response
end
rescue Exception
cleanup!
raise
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment