contentful_model 0.1.4 → 0.1.5
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8400d7ed706da1984ae22bff94c4c428ecb2b9e7
|
|
4
|
+
data.tar.gz: 5021acd89b16206ffecef168e3c389691018234b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0e3111eb0c5bf198a29bd349cc66cd8231fa2dd996b152a5666253e00d722a26d8c1ddd4b148100d2cfa050fb8fa453a5cead625f65445438af7002c6c5aa85a
|
|
7
|
+
data.tar.gz: fb553a246fd47575f8adbc4232dd23b5facf38b1f0d3affad9b86f1bc48e8bc7be36977f61f7a4470220605429d8f7fbaad786f72bf6e1e3ec8bafb153e8b682
|
|
@@ -41,8 +41,12 @@ module ContentfulModel
|
|
|
41
41
|
# @return [Enumerable] which you can iterate over
|
|
42
42
|
define_method :find_ancestors do |&block|
|
|
43
43
|
return enum_for(:find_ancestors) unless block
|
|
44
|
+
if parent.nil?
|
|
45
|
+
#this *is* the parent
|
|
46
|
+
return self
|
|
47
|
+
end
|
|
44
48
|
block.call(parent)
|
|
45
|
-
unless parent.root?
|
|
49
|
+
unless parent && parent.root?
|
|
46
50
|
parent.find_ancestors {|a| block.call(a)}
|
|
47
51
|
end
|
|
48
52
|
end
|