module CustomFragmentCache

Constants

VERSION

Public Class Methods

configuration() click to toggle source
# File lib/custom_fragment_cache/configuration.rb, line 11
def self.configuration
  @configuration ||= Configuration.new
end
configuration=(config) click to toggle source
# File lib/custom_fragment_cache/configuration.rb, line 15
def self.configuration=(config)
  @configuration = config
end
configure() { |configuration| ... } click to toggle source
# File lib/custom_fragment_cache/configuration.rb, line 19
def self.configure
  yield(configuration) if block_given?
end

Public Instance Methods

after_save(record) click to toggle source

Observer support

# File lib/custom_fragment_cache.rb, line 21
def after_save(record)
  fragments_validity(record)
end
fragments_validity(record = self) click to toggle source
# File lib/custom_fragment_cache.rb, line 25
def fragments_validity(record = self)
  self.class.fragment_caches.each do |fragment_cache|
    if expire_cache?(fragment_cache, record)
      expire_fragment(cache_key(fragment_cache.name, record))
    end
  end
end