Forum: Ruby on Rails A bug in sweeper.rb? [was: A frustrating and strange error when config.action_controller.perform_ca

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
C0cb3aadb9a66d00df16686f4a1fc312?d=identicon&s=25 Tim Uckun (Guest)
on 2009-04-18 12:14
(Received via mailing list)
I fired up the debugger and watched the code happen tonight.

The problem occurs if the config.action_controller.perform_caching =
true in
your environment. It's not set to true in development but it is set to
in production and staging.

The problem occurs not in my controllers but in sweeping.rb (part of
Rails calls this code for every controller which was instantiated in the
same request ( I think). Running the page it "sweeps" the following
controllers in this order.


The problem is that on the second call to clean up MatchController it
The code snippets in sweeping.rb  are..

The cleanup is in the following method of sweep.rb

def after(controller)
          callback(:after) if controller.perform_caching
          # Clean up, so that the controller can be collected after this
          self.controller = nil

A little later......

  def callback(timing)
            controller_callback_method_name =
            action_callback_method_name     =

            __send__(controller_callback_method_name) if
respond_to?(controller_callback_method_name, true)
            __send__(action_callback_method_name)     if
respond_to?(action_callback_method_name, true)

The problem is that after the first controller has been cleared
is nil when it gets to the callback (even if it's not nil when it hits
after method)

I am not quite sure what is the problem but could this be a bug in
This topic is locked and can not be replied to.