Sha256: 8ef1c1ca8889ffae5494f897d0c6b4c0feb2ce88c115fa5ab2202c114256b3f4

Contents?: true

Size: 365 Bytes

Versions: 21

Compression:

Stored size: 365 Bytes

Contents

module Alchemy
	class ContentSweeper < ActionController::Caching::Sweeper
		observe Element

		def after_update(element)
			expire_cache_for(element.contents)
		end

		def after_destroy(element)
			expire_cache_for(element.contents)
		end

	private

		def expire_cache_for(contents)
			contents.each do |content|
				expire_fragment(content)
			end
		end

	end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
alchemy_cms-2.1.12 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.11 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.9.1 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.9 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.8.1 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.8 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.7 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.6 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.5 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.4 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.3 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.2 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.1 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.rc6 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.rc5 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.rc4 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.rc3 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.rc2 app/sweepers/alchemy/content_sweeper.rb
alchemy_cms-2.1.beta6 app/sweepers/alchemy/content_sweeper.rb