Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4617

Show
Ignore:
Timestamp:
07/22/06 02:31:21 (2 years ago)
Author:
rick
Message:

Fixed that you can still access the flash after the flash has been reset in reset_session. Closes #5584 [lmarlow@yahoo.com]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r4613 r4617  
    11*SVN* 
     2 
     3* Fixed that you can still access the flash after the flash has been reset in reset_session.  Closes #5584 [lmarlow@yahoo.com] 
    24 
    35* Allow form_for and fields_for to work with indexed form inputs.  [Jeremy Kemper, Matt Lyon] 
  • trunk/actionpack/lib/action_controller/flash.rb

    r4595 r4617  
    148148      def reset_session_with_flash 
    149149        reset_session_without_flash 
    150         @flash = nil 
     150        remove_instance_variable(:@flash) 
     151        flash(:refresh) 
    151152      end 
    152153       
  • trunk/actionpack/test/controller/flash_test.rb

    r3583 r4617  
    3333      @flashy = flash["that"] 
    3434      silence_warnings { keep_flash } 
     35      render :inline => "hello" 
     36    end 
     37 
     38    def use_flash_after_reset_session 
     39      flash["that"] = "hello" 
     40      @flashy_that = flash["that"] 
     41      reset_session 
     42      @flashy_that_reset = flash["that"] 
     43      flash["this"] = "good-bye" 
     44      @flashy_this = flash["this"] 
    3545      render :inline => "hello" 
    3646    end 
     
    8393    assert_nil @response.template.assigns["flashy"] 
    8494  end  
     95   
     96  def test_flash_after_reset_session 
     97    get :use_flash_after_reset_session 
     98    assert_equal "hello",    @response.template.assigns["flashy_that"] 
     99    assert_equal "good-bye", @response.template.assigns["flashy_this"] 
     100    assert_nil   @response.template.assigns["flashy_that_reset"] 
     101  end  
    85102end