Class: SnippetSweeper

Inherits:
ActionController::Caching::Sweeper
  • Object
show all
Defined in:
app/observers/snippet_sweeper.rb

Instance Method Summary collapse

Instance Method Details

#after_destroy(record) ⇒ Object



16
17
18
# File 'app/observers/snippet_sweeper.rb', line 16

def after_destroy(record)
  reset_cms_pages(record)
end

#after_save(record) ⇒ Object



12
13
14
# File 'app/observers/snippet_sweeper.rb', line 12

def after_save(record)
  reset_cms_pages(record)
end

#before_save(record) ⇒ Object



4
5
6
7
8
9
10
# File 'app/observers/snippet_sweeper.rb', line 4

def before_save(record)
  if record.is_a?(SpudSnippet)
    @old_name = record.name_was
  else
    @old_name = nil
  end
end