aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/flash.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-12-28 18:33:44 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-28 18:33:44 -0800
commitbdfd11e6dafb1fac175fa0e7283be31e8849ec67 (patch)
tree8badf0bf6b49d01725b876765743d145cc170b02 /actionpack/lib/action_dispatch/middleware/flash.rb
parentdea160266fee0576c2059a0699cbf93b465e95a2 (diff)
downloadrails-bdfd11e6dafb1fac175fa0e7283be31e8849ec67.tar.gz
rails-bdfd11e6dafb1fac175fa0e7283be31e8849ec67.tar.bz2
rails-bdfd11e6dafb1fac175fa0e7283be31e8849ec67.zip
mutations on the underlying hash should also mutate the discard set
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/flash.rb')
-rw-r--r--actionpack/lib/action_dispatch/middleware/flash.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb
index bf381af9e7..6564a5b16f 100644
--- a/actionpack/lib/action_dispatch/middleware/flash.rb
+++ b/actionpack/lib/action_dispatch/middleware/flash.rb
@@ -93,7 +93,7 @@ module ActionDispatch
end
def []=(k, v) #:nodoc:
- keep(k)
+ @discard.delete k
@flashes[k] = v
end
@@ -102,7 +102,7 @@ module ActionDispatch
end
def update(h) #:nodoc:
- h.keys.each { |k| keep(k) }
+ @discard.subtract h.keys
@flashes.update h
self
end
@@ -116,6 +116,7 @@ module ActionDispatch
end
def delete(key)
+ @discard.delete key
@flashes.delete key
self
end
@@ -129,6 +130,7 @@ module ActionDispatch
end
def clear
+ @discard.clear
@flashes.clear
end
@@ -139,7 +141,7 @@ module ActionDispatch
alias :merge! :update
def replace(h) #:nodoc:
- @discard = Set.new
+ @discard.clear
@flashes.replace h
self
end