Skip to content

Commit

Permalink
Merge pull request #5470 from sandeepravi/warning_fixes
Browse files Browse the repository at this point in the history
fixed - warning: instance variable @controller not initialized
  • Loading branch information
josevalim committed Mar 17, 2012
2 parents ab9f1b6 + 5ae53d5 commit cb0585e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions actionpack/lib/action_controller/caching/sweeping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def cache_sweeper(*sweepers)
class Sweeper < ActiveRecord::Observer #:nodoc:
attr_accessor :controller

def initialize(*args)
super
@controller = nil
end

def before(controller)
self.controller = controller
callback(:before) if controller.perform_caching
Expand Down

0 comments on commit cb0585e

Please sign in to comment.