Sha256: b840681ae9b359b53acf3bf1ef709a9d021abff6c30b11270ce4b18cbad8073f

Contents?: true

Size: 332 Bytes

Versions: 9

Compression:

Stored size: 332 Bytes

Contents

class NewsFeedSweeper < ActionController::Caching::Sweeper
  observe NewsFeed
  def after_save(record)
    Role.all.each do |role|
      expire_fragment(:controller => :news_feeds, :action => :index, :id => record.id, :page => 'title', :role => role.name)
    end
  end

  def after_destroy(record)
    after_save(record)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
enju_news-0.1.0.pre5 app/models/news_feed_sweeper.rb
enju_news-0.1.0.pre4 app/models/news_feed_sweeper.rb
enju_news-0.1.0.pre3 app/models/news_feed_sweeper.rb
enju_news-0.1.0.pre2 app/models/news_feed_sweeper.rb
enju_news-0.1.0.pre app/models/news_feed_sweeper.rb
enju_news-0.0.5 app/models/news_feed_sweeper.rb
enju_news-0.0.4 app/models/news_feed_sweeper.rb
enju_news-0.0.3 app/models/news_feed_sweeper.rb
enju_news-0.0.2 app/models/news_feed_sweeper.rb