Skip to content
Browse files

Merge branch 'master' of git://github.com/jnunemaker/mongomapper

  • Loading branch information...
2 parents 918e5dc + f97b797 commit d35d17a862c9d712723a563d5082c5c96e499465 @fauxparse fauxparse committed Feb 3, 2010
Showing with 9 additions and 3 deletions.
  1. +9 −3 test/functional/test_identity_map.rb
View
12 test/functional/test_identity_map.rb
@@ -365,7 +365,7 @@ class ::Item
key :parent_id, ObjectId
belongs_to :parent, :class_name => 'Item'
- one :child, :class_name => 'Blog'
+ one :blog, :class_name => 'Blog', :foreign_key => 'parent_id'
end
Item.collection.remove
@@ -421,9 +421,15 @@ class ::BlogPost < ::Item
blog = Blog.create(:title => 'Jill')
assert_in_map(blog)
- root = Item.create(:title => 'Root', :child => blog)
+ root = Item.create(:title => 'Root', :blog => blog)
assert_in_map(root)
- root.child.should equal(blog)
+ root.blog.should equal(blog)
+ end
+
+ should "work correctly with one proxy create" do
+ root = Item.create(:title => 'Root')
+ blog = root.blog.create(:title => 'Blog')
+ blog.parent.should equal(root)
end
end

0 comments on commit d35d17a

Please sign in to comment.
Something went wrong with that request. Please try again.