From 28ef328baa7bdc134667b7da3d5e8b0777a35cc0 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 5 Jul 2006 01:14:53 +0000 Subject: Fixed that the flash should be reset when reset_session is called (closes #5584) [shugo@ruby-lang.org] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4540 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/flash.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/flash.rb') diff --git a/actionpack/lib/action_controller/flash.rb b/actionpack/lib/action_controller/flash.rb index 61ac33f399..ea7a49ab77 100644 --- a/actionpack/lib/action_controller/flash.rb +++ b/actionpack/lib/action_controller/flash.rb @@ -30,6 +30,7 @@ module ActionController #:nodoc: base.class_eval do alias_method_chain :assign_shortcuts, :flash alias_method_chain :process_cleanup, :flash + alias_method_chain :reset_session, :flash end end @@ -143,6 +144,11 @@ module ActionController #:nodoc: flash.sweep if @session process_cleanup_without_flash end + + def reset_session_with_flash + reset_session_without_flash + @flash = nil + end protected # Access the contents of the flash. Use flash["notice"] to read a notice you put there or @@ -172,4 +178,4 @@ module ActionController #:nodoc: end end end -end \ No newline at end of file +end -- cgit v1.2.3