Module: Cell::Caching

Extended by:
ActiveSupport::Concern
Included in:
Rails
Defined in:
lib/cell/caching.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#render_state(state, *args) ⇒ Object



87
88
89
90
91
92
93
94
95
96
# File 'lib/cell/caching.rb', line 87

def render_state(state, *args)
  return super(state, *args) unless self.class.cache?(state)
  
  key     = self.class.state_cache_key(state, call_state_versioner(state, *args))
  options = self.class.cache_options[state]
  
  self.class.cache_store.fetch(key, options) do
    super(state, *args)
  end
end