Sha256: a9aa7efb79d497de17132987fbb5292daaddc1d5e92b4f282323bba70bfc1136

Contents?: true

Size: 318 Bytes

Versions: 9

Compression:

Stored size: 318 Bytes

Contents

class PageSweeper < ActionController::Caching::Sweeper
	observe Page
	
	def after_create(item)
		expire(item)
	end
	
	def after_update(item)
		expire(item)
	end
	
	def after_destroy(item)
		expire(item)
	end
	
	private
	
	  def expire(item=nil)
  	  expire_fragment(%r{/pages})
  	  StructureSweeper.sweep!
	  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
sunrise-core-0.1.3 lib/generators/sunrise/templates/sweepers/page_sweeper.rb
sunrise-core-0.1.2 lib/generators/sunrise/templates/sweepers/page_sweeper.rb
sunrise-core-0.1.1 lib/generators/sunrise/templates/sweepers/page_sweeper.rb
sunrise-core-0.1.0 lib/generators/sunrise/templates/sweepers/page_sweeper.rb
freeberry-0.3.0 lib/generators/freeberry/base/templates/sweepers/page_sweeper.rb
freeberry-0.2.9 lib/generators/freeberry/base/templates/sweepers/page_sweeper.rb
freeberry-0.2.7 lib/generators/freeberry/base/templates/sweepers/page_sweeper.rb
freeberry-0.2.6 lib/generators/freeberry/base/templates/sweepers/page_sweeper.rb
freeberry-0.2.5 lib/generators/freeberry/base/templates/sweepers/page_sweeper.rb