diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/flash.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/flash.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index 6eda1f31a7..e7090ecf1b 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -43,12 +43,9 @@ module ActionDispatch class FlashNow #:nodoc: def initialize(flash) @flash = flash - @closed = false end - attr_reader :closed - alias :closed? :closed - def close!; @closed = true end + alias :closed? :frozen? def []=(k, v) raise ClosedError, :flash if closed? @@ -76,12 +73,9 @@ module ActionDispatch def initialize #:nodoc: super @used = Set.new - @closed = false end - attr_reader :closed - alias :closed? :closed - def close!; @closed = true end + alias :closed? :frozen? def []=(k, v) #:nodoc: raise ClosedError, :flash if closed? @@ -200,7 +194,7 @@ module ActionDispatch if !flash_hash.empty? || session.key?('flash') session["flash"] = flash_hash end - flash_hash.close! + flash_hash.freeze end if session.key?('flash') && session['flash'].empty? |