Class: AdequateSerialization::Rails::CacheStep
- Inherits:
-
Steps::Step
- Object
- Steps::Step
- AdequateSerialization::Rails::CacheStep
- Defined in:
- lib/adequate_serialization/rails/cache_step.rb
Instance Attribute Summary
Attributes inherited from Steps::Step
Instance Method Summary collapse
Methods inherited from Steps::Step
Constructor Details
This class inherits a constructor from AdequateSerialization::Steps::Step
Instance Method Details
#apply(response) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/adequate_serialization/rails/cache_step.rb', line 20 def apply(response) object = response.object opts = response.opts if opts.[:multi_caching] || !CacheKey.cacheable?(object) return apply_next(response) end ::Rails.cache.fetch(CacheKey.for(object, opts.includes)) do apply_next(response) end end |