diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-28 18:39:39 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-28 18:39:39 -0800 |
commit | afd9512c0b4ff98f3fec2ff9fd78d430b2ace974 (patch) | |
tree | 201015a2a76ab1b4d0bd2cd5a00405ae017364f4 /actionpack/lib/action_dispatch | |
parent | bdfd11e6dafb1fac175fa0e7283be31e8849ec67 (diff) | |
download | rails-afd9512c0b4ff98f3fec2ff9fd78d430b2ace974.tar.gz rails-afd9512c0b4ff98f3fec2ff9fd78d430b2ace974.tar.bz2 rails-afd9512c0b4ff98f3fec2ff9fd78d430b2ace974.zip |
simplify sweep now that discard and flashes are in sync
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/flash.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index 6564a5b16f..cff0877030 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -182,14 +182,8 @@ module ActionDispatch # # This method is called automatically by filters, so you generally don't need to care about it. def sweep #:nodoc: - keys.each do |k| - unless @discard.include?(k) - @discard << k - else - delete(k) - @discard.delete(k) - end - end + @discard.each { |k| @flashes.delete k } + @discard.replace @flashes.keys end # Convenience accessor for flash[:alert] |