mongoid-tree 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/mongoid/tree.rb +11 -1
  4. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c0a26ae177450bbaad3455f5c36c1e2bfdf82ce
4
- data.tar.gz: b4f92b96a94dc9309cb8ef15e915faf96b8ad9a4
3
+ metadata.gz: fdc505bb8df0d134efa3f5f4d3afca14603a44cd
4
+ data.tar.gz: 2615195789c03a83ffe7cce55218ac0c9e8ff5e3
5
5
  SHA512:
6
- metadata.gz: 559cba3006168c5911f978d0be4329a5177d70dcb3b51f49c69342fdc948a8111ae76e99654c80051ff4869cb34a0bf3a6e1b28374388b210b2f968f93b82073
7
- data.tar.gz: 94e790142a3f4154d7519f295f3770dfcdee02aba1686e914e9b9517f3f1458490dbf3179c7d242e147654475b385e97171453edf0e1df69e90cc8a3980492fe
6
+ metadata.gz: 8cd3e9933fa16933ba6044826fe5bd935b4d2f93f4580c5bf63ebf2d6480a0941dedeb48b3b06118b2827e87564020760d4b6421fcb87b760846d69296b3078b
7
+ data.tar.gz: 4a3609b0eb8e493952f3cf3bc222fc217a14f2a06cee2dae34f128fec7f4438a8f9ab30370cea2fbf6f146d2ff98c607e1b0afc15b70f32950aeef9ad7e27eaa
data/README.md CHANGED
@@ -4,7 +4,7 @@ A tree structure for Mongoid documents using the materialized path pattern
4
4
 
5
5
  ## Requirements
6
6
 
7
- * mongoid (>= 4.0, < 6.0)
7
+ * mongoid (>= 4.0, < 7.0)
8
8
 
9
9
  For a mongoid 3.x compatible version, please use mongoid-tree 1.0.x,
10
10
  for a mongoid 2.x compatible version, please use mongoid-tree 0.7.x.
@@ -87,7 +87,17 @@ module Mongoid
87
87
  included do
88
88
  has_many :children, :class_name => self.name, :foreign_key => :parent_id, :inverse_of => :parent, :validate => false
89
89
 
90
- belongs_to :parent, :class_name => self.name, :inverse_of => :children, :index => true, :validate => false
90
+ options = {
91
+ :class_name => self.name,
92
+ :inverse_of => :children,
93
+ :index => true,
94
+ :validate => false,
95
+ :optional => true
96
+ }
97
+
98
+ options.delete(:optional) if Gem::Version.new(Mongoid::VERSION) < Gem::Version.new('6.0.0.beta')
99
+
100
+ belongs_to :parent, options
91
101
 
92
102
  field :parent_ids, :type => Array, :default => []
93
103
  index :parent_ids => 1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benedikt Deicke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-23 00:00:00.000000000 Z
11
+ date: 2016-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - "<"
18
18
  - !ruby/object:Gem::Version
19
- version: '6.0'
19
+ version: '7.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: '4.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - "<"
28
28
  - !ruby/object:Gem::Version
29
- version: '6.0'
29
+ version: '7.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4.0'
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.4.5
116
+ rubygems_version: 2.5.1
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: A tree structure for Mongoid documents