diff options
author | wycats <wycats@gmail.com> | 2010-06-04 10:03:53 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-06-04 20:11:05 -0700 |
commit | cb1b2a719ac2ba31dc8d66195c0be32798255be0 (patch) | |
tree | bc7ebac887f951dca604c7e477c47bdd8aac5d02 /actionpack/lib/action_dispatch/middleware/flash.rb | |
parent | a260e02fd3e967d2d6b602aa3bd15f952d4e45cc (diff) | |
download | rails-cb1b2a719ac2ba31dc8d66195c0be32798255be0.tar.gz rails-cb1b2a719ac2ba31dc8d66195c0be32798255be0.tar.bz2 rails-cb1b2a719ac2ba31dc8d66195c0be32798255be0.zip |
Stop the flash middleware from forcibly loading sessions even if the user doesn't use sessions at all
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/flash.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/flash.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index adde183cdb..043966a585 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -170,13 +170,13 @@ module ActionDispatch end def call(env) - if (session = env['rack.session']) && (flash = session['flash']) + if (session = env['rack.session']) && session.key?('flash') flash.sweep end @app.call(env) ensure - if (session = env['rack.session']) && (flash = session['flash']) && flash.empty? + if (session = env['rack.session']) && session.key?('flash') && session['flash'].empty? session.delete('flash') end end |