Class: FeedKiller

Inherits:
ActiveRecord::Observer
  • Object
show all
Defined in:
app/models/feed_killer.rb

Instance Method Summary collapse

Instance Method Details

#after_save(post) ⇒ Object



4
5
6
# File 'app/models/feed_killer.rb', line 4

def after_save(post)
  @user = post.user.username
end

#filter(controller) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'app/models/feed_killer.rb', line 8

def filter(controller)
  # Invalidate the user's feed
  controller.expire_page :controller => 'rss',  :action => @user
  controller.expire_page :controller => 'atom', :action => @user
  
  # Invalidate the main feeds
  controller.expire_page :controller => 'rss',  :action => 'index'
  controller.expire_page :controller => 'atom', :action => 'feed'
end