Permalink
Browse files

Ensure controller isn't leaked in ActiveController around filter

  • Loading branch information...
1 parent ae4da5b commit 4703a5361d9db0e67e1020ffa0ed278e83556f22 @braintreeps braintreeps committed Aug 7, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/audited/sweeper.rb
View
@@ -4,13 +4,13 @@ class Sweeper < ActiveModel::Observer
attr_accessor :controller
- def before(controller)
- self.controller = controller
- true
- end
-
- def after(controller)
- self.controller = nil
+ def around(controller)
+ begin
+ self.controller = controller
+ yield
+ ensure
+ self.controller = nil
+ end
end
def before_create(audit)

0 comments on commit 4703a53

Please sign in to comment.