mongo_mapper 0.8.1 → 0.8.2

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.
@@ -32,7 +32,7 @@ module MongoMapper
32
32
  end
33
33
 
34
34
  def assign_references(doc)
35
- doc._parent_document = proxy_owner
35
+ doc._parent_document = proxy_owner if doc
36
36
  end
37
37
  end
38
38
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module MongoMapper
3
- Version = '0.8.1'
3
+ Version = '0.8.2'
4
4
  end
@@ -45,6 +45,15 @@ class OneEmbeddedProxyTest < Test::Unit::TestCase
45
45
  post.author.should == new_author
46
46
  end
47
47
 
48
+ should "not have problem loading root document if embedded one is nil" do
49
+ @post_class.one :author, :class => @author_class
50
+ post = @post_class.create
51
+
52
+ lambda {
53
+ @post_class.find(post.id)
54
+ }.should_not raise_error
55
+ end
56
+
48
57
  should "have boolean method for testing presence" do
49
58
  @post_class.one :author, :class => @author_class
50
59
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 8
8
- - 1
9
- version: 0.8.1
8
+ - 2
9
+ version: 0.8.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Nunemaker