through_hierarchy 0.1.0 → 0.1.1
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 +6 -0
- 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: 74f01013ac5a0df1c24c2ca7202d6de47936dcff
|
4
|
+
data.tar.gz: 1c2e2a79defb580b6449e90535f6683725996497
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5026fbd509012ffd95864c8732fe08ca37dc398ea8ef36688f7d0cd76cdd42082aaae32b8022a02ae9725d5b98482cbacd22ef8ce150e3c8cfc4f561bfae1416
|
7
|
+
data.tar.gz: 8b246b81fedf869e249b66dc9074c0bb922264bd840914c36b27f7a3209c7c4868330d9f0b10c5c68c86f91d5dc1fc61fb0c8c83f0d12aa5e792b5d62ca3a0ca
|
@@ -14,6 +14,12 @@ module ThroughHierarchy
|
|
14
14
|
end
|
15
15
|
|
16
16
|
module ClassMethods
|
17
|
+
# deep_dup these class attributes on inheritance so we can safely use in-place modifiers
|
18
|
+
def inherited(child)
|
19
|
+
child.hierarchical_associations = self.hierarchical_associations.deep_dup
|
20
|
+
super
|
21
|
+
end
|
22
|
+
|
17
23
|
def through_hierarchy(members, &blk)
|
18
24
|
Hierarchy.new(self, members).instance_eval(&blk)
|
19
25
|
end
|