jmonteiro-mongo_mapper 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -12,7 +12,7 @@ module MongoMapper
12
12
  protected
13
13
  def find_target
14
14
  (@_values || []).map do |hash|
15
- child = polymorphic_class(hash).new(hash)
15
+ child = polymorphic_class(hash).load(hash)
16
16
  assign_root_document(child)
17
17
  child
18
18
  end
@@ -12,7 +12,7 @@ module MongoMapper
12
12
  private
13
13
  def find_target
14
14
  (@_values || []).map do |v|
15
- child = klass.new(v)
15
+ child = klass.load(v)
16
16
  assign_root_document(child)
17
17
  child
18
18
  end
@@ -27,6 +27,7 @@ class ManyEmbeddedPolymorphicProxyTest < Test::Unit::TestCase
27
27
  catalog = catalog.reload
28
28
  catalog.medias.size.should == 1
29
29
  catalog.medias[0].file.should == 'video.mpg'
30
+ catalog.medias[0].new?.should == false
30
31
  end
31
32
 
32
33
  context "count" do
@@ -49,7 +49,9 @@ class ManyEmbeddedProxyTest < Test::Unit::TestCase
49
49
  post.reload
50
50
  post.comments.size.should == 2
51
51
  post.comments[0].should == frank
52
+ post.comments[0].new?.should == false
52
53
  post.comments[1].should == bill
54
+ post.comments[1].new?.should == false
53
55
  end
54
56
 
55
57
  should "allow embedding arbitrarily deep" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jmonteiro-mongo_mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-01-13 00:00:00 -02:00
13
+ date: 2010-01-14 00:00:00 -02:00
14
14
  default_executable: mmconsole
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency