Class: CommentSweeper

Inherits:
ActionController::Caching::Sweeper
  • Object
show all
Defined in:
app/controllers/comment_sweeper.rb

Instance Method Summary collapse

Instance Method Details

#after_create(comment) ⇒ Object


4
5
6
# File 'app/controllers/comment_sweeper.rb', line 4

def after_create(comment)
  expire_cache_for(comment)
end

#after_destroy(comment) ⇒ Object

If our sweeper detects that a comment was deleted call this


14
15
16
# File 'app/controllers/comment_sweeper.rb', line 14

def after_destroy(comment)
  expire_cache_for(comment)
end

#after_update(comment) ⇒ Object

If our sweeper detects that a comment was updated call this


9
10
11
# File 'app/controllers/comment_sweeper.rb', line 9

def after_update(comment)
  expire_cache_for(comment)
end