1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

ask the request object for the session

The flash middleware shouldn't know how to look up the session object.
Just ask the request for that information.
This commit is contained in:
Aaron Patterson 2015-09-22 17:43:15 -07:00
parent a9f28600e9
commit 9f23ee0fdc

View file

@ -276,7 +276,7 @@ module ActionDispatch
req = ActionDispatch::Request.new env
@app.call(env)
ensure
session = Request::Session.find(req) || {}
session = req.session || {}
flash_hash = req.flash_hash
if flash_hash && (flash_hash.present? || session.key?('flash'))