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

Ticket #6223: render_component_fix_for_caching_rb.diff

File render_component_fix_for_caching_rb.diff, 0.8 kB (added by fosf, 2 years ago)
  • caching.rb

    old new  
    581581        # However, subclasses of ActionController::Caching::Sweeper should be Reloadable 
    582582        include Reloadable::Deprecated 
    583583         
     584        def initialize 
     585          self.controller_stack = [] 
     586        end 
     587 
    584588        def before(controller) 
     589          self.controller_stack << controller 
    585590          self.controller = controller 
    586591          callback(:before) 
    587592        end 
    588593 
    589594        def after(controller) 
    590595          callback(:after) 
    591           # Clean up, so that the controller can be collected after this request 
    592           self.controller = nil 
     596          self.controller_stack.pop 
     597          self.controller = self.controller_stack.last 
    593598        end 
    594599 
    595600        private