Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #10580 from CodeTag/master

Code cleanup for ActionDispatch::Flash#call
  • Loading branch information...
commit 3a0e579b9dc0e36f37420f03a89c69480c6c2e64 2 parents 2519fb0 + c43ca06
@guilleiguaran guilleiguaran authored
Showing with 3 additions and 9 deletions.
  1. +3 −9 actionpack/lib/action_dispatch/middleware/flash.rb
View
12 actionpack/lib/action_dispatch/middleware/flash.rb
@@ -243,15 +243,9 @@ def call(env)
session = Request::Session.find(env) || {}
flash_hash = env[KEY]
- if flash_hash
- if !flash_hash.empty? || session.key?('flash')
- session["flash"] = flash_hash.to_session_value
- new_hash = flash_hash.dup
- else
- new_hash = flash_hash
- end
-
- env[KEY] = new_hash
+ if flash_hash.present? || session.key?('flash')
+ session["flash"] = flash_hash.to_session_value
+ env[KEY] = flash_hash.dup
end
if (!session.respond_to?(:loaded?) || session.loaded?) && # (reset_session uses {}, which doesn't implement #loaded?)
Please sign in to comment.
Something went wrong with that request. Please try again.