aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorBrian John <brian@brianjohn.com>2012-07-18 19:50:25 -0500
committerBrian John <brian@brianjohn.com>2012-07-20 05:49:45 -0500
commit35fe3107a39271c9694e5094c1352c30463582e4 (patch)
tree08a0272b95f17c9a3036f54badc7d8e12e050ec8 /actionpack/lib
parente482100d6ed022d00ba31c6c4377f6f947173337 (diff)
downloadrails-35fe3107a39271c9694e5094c1352c30463582e4.tar.gz
rails-35fe3107a39271c9694e5094c1352c30463582e4.tar.bz2
rails-35fe3107a39271c9694e5094c1352c30463582e4.zip
Clean up Sweeper controller accessor when an Error is raised
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/caching/sweeping.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/caching/sweeping.rb b/actionpack/lib/action_controller/caching/sweeping.rb
index 39da15e26a..73291ce083 100644
--- a/actionpack/lib/action_controller/caching/sweeping.rb
+++ b/actionpack/lib/action_controller/caching/sweeping.rb
@@ -68,14 +68,14 @@ module ActionController #:nodoc:
def after(controller)
self.controller = controller
callback(:after) if controller.perform_caching
- # Clean up, so that the controller can be collected after this request
- self.controller = nil
end
def around(controller)
before(controller)
yield
after(controller)
+ ensure
+ clean_up
end
protected
@@ -90,6 +90,11 @@ module ActionController #:nodoc:
end
private
+ def clean_up
+ # Clean up, so that the controller can be collected after this request
+ self.controller = nil
+ end
+
def callback(timing)
controller_callback_method_name = "#{timing}_#{controller.controller_name.underscore}"
action_callback_method_name = "#{controller_callback_method_name}_#{controller.action_name}"