Module: Cms::Behaviors::FlushCacheOnChange::MacroMethods

Defined in:
lib/cms/behaviors/flush_cache_on_change.rb

Instance Method Summary collapse

Instance Method Details

#flush_cache_on_change(options = {}) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/cms/behaviors/flush_cache_on_change.rb', line 16

def flush_cache_on_change(options={})
  include InstanceMethods
  @flush_cache_on_change = true
  
  after_save :flush_cache
  after_destroy :flush_cache
end

#flush_cache_on_change?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/cms/behaviors/flush_cache_on_change.rb', line 13

def flush_cache_on_change?
  !!@flush_cache_on_change
end