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: 209fd18d71e5f92e2e101d42dbc12c2a1028c841
4
- data.tar.gz: 16b9e1322d5102c7be988ca982f99f32e3ff0dc1
3
+ metadata.gz: 8400d7ed706da1984ae22bff94c4c428ecb2b9e7
4
+ data.tar.gz: 5021acd89b16206ffecef168e3c389691018234b
5
5
  SHA512:
6
- metadata.gz: 64ae64418a0f5b3d9687e2c4446de39ac92002d87b3eec38b0a6aeeb709f8b5f1eb49ee39b1fd1759fe403e29e5f86281e779023c21abcc5e1a81aa95e9ba2bb
7
- data.tar.gz: adecfdeaabf91259bd92ea9225d58e35db73e3da88d0be1706078b6cea9fa886f5b3cb81b13545d5e20b8935c704e24950f6d92ea0fd8112949d3dacad4b3c0a
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
@@ -1,3 +1,3 @@
1
1
  module ContentfulModel
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful_model
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
  - Error Creative Studio