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 +4 -4
- data/lib/through_hierarchy/base.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3bc6c2921451d1379f51c422e11ef87fb7ba934
|
4
|
+
data.tar.gz: 737084656d7148d237c1dee59f17290fc84a7e27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
9
|
+
after_initialize :clear_hierarchical_association_cache
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
|
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
|