mongoid-graph 0.0.3 → 0.0.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.
@@ -1,3 +1,3 @@
1
1
  module MongoidGraph
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -27,7 +27,7 @@ module Mongoid
27
27
  protected
28
28
 
29
29
  def generate_mongoid_neighbours
30
- self._neighbours = []
30
+ self._neighbours ||= []
31
31
  end
32
32
  end
33
33
  end
@@ -37,4 +37,12 @@ describe Node do
37
37
  @third_node.save!
38
38
  Node.neighbours_of(@first_node).size.should == 1
39
39
  end
40
+
41
+ it "should have neighbours after save" do
42
+ @first_node.connect_to @second_node
43
+ @first_node.save!
44
+ @second_node.save!
45
+ first_node = Node.where(node_index: 1).first
46
+ Node.neighbours_of(first_node).size.should == 1
47
+ end
40
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: