cache_utils 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a539d683e68d801fdd17735c49d5e15ad47e5c3f
4
- data.tar.gz: 06f2c3deda727144695de513fe6e9fb9a2d8520f
3
+ metadata.gz: a748668ea86e250e5cbe25c593f6131aacf06f75
4
+ data.tar.gz: 8bc54cc80bcd345f690c884d45930775baf639d4
5
5
  SHA512:
6
- metadata.gz: 9eeeb919ac72942c52704bc5e332ab84f859e6aabb85fc83478ed420ef34b814f25f1ca3eeee8c7a1258ea96ce5f3caa81a59029ec31c647448cbc2813c9f9d5
7
- data.tar.gz: 01bff05e89a7c6107923bad3f2bcecc8d66284f680bb2ef25d28715c8b5831e39da41b88337c107e99372b79ef8d028a2bf621efe100143b8e1e6608c8302357
6
+ metadata.gz: 84e017bb9f2f2ffafc004baac55e8efdcb45cce03887a6682fa563c6cee34cbf12300aba02cd462a82c041e22d407e2dcfa2b2f3b1f36c08a12f38bd57e1b34d
7
+ data.tar.gz: 7eb218e0a42b34c56ec8601f6f5160ac846380150a100a33dc65be2fe708ac5e4a0944d3ebf97cb4965bf5599e31af97765ec5189cb0a27694be658897f5f600
@@ -4,7 +4,7 @@ module CacheUtils
4
4
 
5
5
  module ClassMethods
6
6
  def cache_key
7
- to_s.pluralize.underscore + '/index'
7
+ to_s.underscore.pluralize + '/index'
8
8
  end
9
9
  end
10
10
 
@@ -12,6 +12,10 @@ module CacheUtils
12
12
  after_save :purge_cache
13
13
  end
14
14
 
15
+ def custom_cache_key
16
+ self.class.to_s.underscore.pluralize + "/#{id}"
17
+ end
18
+
15
19
  def purge_cache
16
20
  Rails.cache.data.del(*(Rails.cache.data.keys(cache_key) + [self.class.cache_key]))
17
21
  end
@@ -1,3 +1,3 @@
1
1
  module CacheUtils
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michele Finotto