dyoder (owner)

Revisions

gist: 129417 Download_button fork
public
Public Clone URL: git://gist.github.com/129417.git
Embed All Files: show embed
new_sweeper.rb #
1
2
3
4
5
6
7
8
9
10
11
class CompanySweeper < ActionController::Caching::Sweeper
 
  observe Company, Comment, Document, Order, Trade
  
  %w( create update destroy ).each do | action |
    define_method( "after_#{action}") do | instance |
      %w( index companies/* pages/home ).each { |p| `rm -rf public/cache/views/#{p}.html.cache` }
    end
  end
   
end