through_hierarchy 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d41873c002c11a72dcafce92b48442528bc65dd9
4
- data.tar.gz: d73325d3873043e7cc5d032f5e328b9e1d4599e3
3
+ metadata.gz: f3bc6c2921451d1379f51c422e11ef87fb7ba934
4
+ data.tar.gz: 737084656d7148d237c1dee59f17290fc84a7e27
5
5
  SHA512:
6
- metadata.gz: fac69ea4f39f547be70efb5f21887ebdab5d87991a608654212bbf688082b46acdc77f07e75bfe249232db57e918b71108e139229ebda3805a209f695545a5fd
7
- data.tar.gz: 2646834aba9ac917a833d8869a2e79ea1f1faad44fa9d12a8c8ca7df28b6cebc61bf943430e7efc08a45b91fb6266b4d59f556fc6da9fd4b7800c10d9ab51a7f
6
+ metadata.gz: 36241a8007d284967306a4ce63cc6ff5de5624e3950e4c88534b9b47292a851cc6182ac2574f36333c0c5f8f74e28c0a95f123aac3b7bea2e33921caa471b463
7
+ data.tar.gz: 7feba64bceb116fbd151b7bc2b0562931bcc43ca96260d82cf5d056bedad1f1057e5530d47100bcedffb82ab9f233ae48ef524053a364dd78eb338609f7927ec
@@ -6,11 +6,15 @@ module ThroughHierarchy
6
6
  class_attribute :hierarchical_associations
7
7
  self.hierarchical_associations = {}
8
8
  attr_reader :hierarchical_association_cache
9
- after_initialize :reset_hierarchical_association_cache
9
+ after_initialize :clear_hierarchical_association_cache
10
10
  end
11
11
 
12
- def reset_hierarchical_association_cache
13
- @hierarchical_association_cache = {}
12
+ def clear_hierarchical_association_cache(name = nil)
13
+ if name.nil?
14
+ @hierarchical_association_cache = {}
15
+ else
16
+ @hierarchical_association_cache.delete(name)
17
+ end
14
18
  end
15
19
 
16
20
  module ClassMethods
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: through_hierarchy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Schwartz