Permalink
Browse files

Fix issue with 0.8 raising exception when finding root document with …

…one embedded doc that is nil.
  • Loading branch information...
1 parent 99eb4dc commit 8bdc2a8467e8079fec81317e216e565b478d8d30 @jnunemaker jnunemaker committed Jun 18, 2010
@@ -32,7 +32,7 @@ def find_target
end
def assign_references(doc)
- doc._parent_document = proxy_owner
+ doc._parent_document = proxy_owner if doc
end
end
end
@@ -45,6 +45,15 @@ def setup
post.author.should == new_author
end
+ should "not have problem loading root document if embedded one is nil" do
+ @post_class.one :author, :class => @author_class
+ post = @post_class.create
+
+ lambda {
+ @post_class.find(post.id)
+ }.should_not raise_error
+ end
+
should "have boolean method for testing presence" do
@post_class.one :author, :class => @author_class

0 comments on commit 8bdc2a8

Please sign in to comment.