Skip to content

Commit

Permalink
simplify sweep now that discard and flashes are in sync
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Dec 29, 2011
1 parent bdfd11e commit afd9512
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions actionpack/lib/action_dispatch/middleware/flash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit afd9512

Please sign in to comment.