Sha256: 3efdb20469e2abf78ba41e9a9a86f2903762648ec67bcb71eaa69d0fcab70c10

Contents?: true

Size: 422 Bytes

Versions: 13

Compression:

Stored size: 422 Bytes

Contents

class CmsContentSweeper < ActionController::Caching::Sweeper
  observe CmsPage, CmsTemplate, CmsSnippet
  
  def after_save(record)
    delete_all_cached_pages
  end
  
  def after_destroy(record)
    delete_all_cached_pages
  end
  
  def delete_all_cached_pages
    CmsPage.find_each do |page|
      expire_page :controller => 'cms/content', :action => 'show', :content_path => page.path.split('/')
    end
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
imagine_cms-3.0.8 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.7 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.6 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.5 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.4 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.3 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.2 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.1 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.0 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.0.beta13 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.0.beta12 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.0.beta11 app/sweepers/cms_content_sweeper.rb
imagine_cms-3.0.0.beta10 app/sweepers/cms_content_sweeper.rb