Changeset 8819
- Timestamp:
- 02/07/08 22:50:49 (7 months ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/caching/sweeping.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r8813 r8819 1 1 *SVN* 2 3 * Added support for naming concrete classes in sweeper declarations [DHH] 2 4 3 5 * Remove ERB trim variables from trace template in case ActionView::Base.erb_trim_mode is changed in the application. #10098 [tpope, kampers] trunk/actionpack/lib/action_controller/caching/sweeping.rb
r8546 r8819 23 23 # 24 24 # In the example above, four actions are cached and three actions are responsible for expiring those caches. 25 # 26 # You can also name an explicit class in the declaration of a sweeper, which is needed if the sweeper is in a module: 27 # 28 # class ListsController < ApplicationController 29 # caches_action :index, :show, :public, :feed 30 # cache_sweeper OpenBar::Sweeper, :only => [ :edit, :destroy, :share ] 31 # end 25 32 module Sweeping 26 33 def self.included(base) #:nodoc: … … 32 39 return unless perform_caching 33 40 configuration = sweepers.extract_options! 41 34 42 sweepers.each do |sweeper| 35 43 ActiveRecord::Base.observers << sweeper if defined?(ActiveRecord) and defined?(ActiveRecord::Base) 36 sweeper_instance = Object.const_get(Inflector.classify(sweeper)).instance44 sweeper_instance = (sweeper.is_a?(Symbol) ? Object.const_get(Inflector.classify(sweeper)) : sweeper).instance 37 45 38 46 if sweeper_instance.is_a?(Sweeper)