Class: PostSweeper

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

Instance Method Summary collapse

Instance Method Details

#after_create(post) ⇒ Object

If our sweeper detects that a Post was created call this


5
6
7
# File 'app/controllers/post_sweeper.rb', line 5

def after_create(post)
  expire_cache_for(post)
end

#after_destroy(post) ⇒ Object

If our sweeper detects that a Post was deleted call this


15
16
17
# File 'app/controllers/post_sweeper.rb', line 15

def after_destroy(post)
  expire_cache_for(post)
end

#after_update(post) ⇒ Object

If our sweeper detects that a Post was updated call this


10
11
12
# File 'app/controllers/post_sweeper.rb', line 10

def after_update(post)
  expire_cache_for(post)
end