Sha256: 80a0ae0eebac8b498a2c498e5c655aa8c4242ac6267bc0abae20a46dc239ecb5

Contents?: true

Size: 255 Bytes

Versions: 9

Compression:

Stored size: 255 Bytes

Contents

class UserSweeper < ActionController::Caching::Sweeper
	observe User
	
	def after_update(item)
		expire(item)
	end
	
	def after_destroy(item)
		expire(item)
	end
	
	private
	
	  def expire(item=nil)
  	  expire_fragment(%r{/users/#{item.id}*})
	  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

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