Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

simplify sweep now that discard and flashes are in sync

  • Loading branch information...
commit afd9512c0b4ff98f3fec2ff9fd78d430b2ace974 1 parent bdfd11e
Aaron Patterson tenderlove authored
Showing with 2 additions and 8 deletions.
  1. +2 −8 actionpack/lib/action_dispatch/middleware/flash.rb
10 actionpack/lib/action_dispatch/middleware/flash.rb
View
@@ -182,14 +182,8 @@ def discard(k = nil)
#
# 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]
Please sign in to comment.
Something went wrong with that request. Please try again.