Module: WCC::Blogs::Concerns::Caching
- Included in:
- WCC::Blogs::Collection, Post, PostSummary, Property
- Defined in:
- lib/wcc/blogs/concerns/caching.rb
Instance Method Summary collapse
Instance Method Details
#cache_key ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/wcc/blogs/concerns/caching.rb', line 5 def cache_key unless defined?(ActiveRecord::Base) && ActiveRecord::Base.respond_to?(:cache_versioning) && ActiveRecord::Base.cache_versioning == true return cache_key_with_version end cache_key_without_version end |
#cache_key_with_version ⇒ Object
16 17 18 |
# File 'lib/wcc/blogs/concerns/caching.rb', line 16 def cache_key_with_version [cache_key_without_version, cache_version].join('/') end |
#cache_version ⇒ Object
20 21 22 |
# File 'lib/wcc/blogs/concerns/caching.rb', line 20 def cache_version updated_at&.to_i end |