Class: Spree::ThemesTemplate::CacheResolver

Inherits:
ActionView::FileSystemResolver
  • Object
show all
Defined in:
app/models/spree/themes_template/cache_resolver.rb

Constant Summary collapse

FRAGMENT_CACHE_PATH_REGEX =
/\A(views\/spree_cache)/
FRAGMENT_CACHE_KEY =
'spree_cache'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CacheResolver

Returns a new instance of CacheResolver.



7
8
9
# File 'app/models/spree/themes_template/cache_resolver.rb', line 7

def initialize(path)
  super(path)
end

Class Method Details

.cache_keyObject



16
17
18
# File 'app/models/spree/themes_template/cache_resolver.rb', line 16

def self.cache_key
  ActiveSupport::Cache.expand_cache_key('updated_at', 'loaded_templates')
end

Instance Method Details

#find_all(*args) ⇒ Object



11
12
13
14
# File 'app/models/spree/themes_template/cache_resolver.rb', line 11

def find_all(*args)
  clear_cache_if_necessary
  super
end