garner 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,8 +5,9 @@ module Garner
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
- before_save :invalidate_api_cache
9
- before_destroy :invalidate_api_cache
8
+ after_create :invalidate_api_cache_for_class
9
+ after_update :invalidate_api_cache
10
+ after_destroy :invalidate_api_cache
10
11
  cattr_accessor :api_cache_class
11
12
  end
12
13
 
@@ -20,7 +21,12 @@ module Garner
20
21
  end
21
22
  Garner::Cache::ObjectIdentity.invalidate(cache_class)
22
23
  end
23
-
24
+
25
+ def invalidate_api_cache_for_class
26
+ cache_class = self.class.api_cache_class || self.class
27
+ Garner::Cache::ObjectIdentity.invalidate(cache_class)
28
+ end
29
+
24
30
  # navigate the parent embedding document hierarchy
25
31
  def all_embedding_documents
26
32
  obj = self
@@ -1,3 +1,3 @@
1
1
  module Garner
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-20 00:00:00.000000000 Z
13
+ date: 2013-01-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -263,7 +263,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
263
263
  version: '0'
264
264
  segments:
265
265
  - 0
266
- hash: 840498015168322473
266
+ hash: 889347935123245080
267
267
  required_rubygems_version: !ruby/object:Gem::Requirement
268
268
  none: false
269
269
  requirements: