mongo_mapper-unstable 2010.1.12 → 2010.1.17

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2010.01.12
1
+ 2010.01.17
@@ -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
data/lib/mongo_mapper.rb CHANGED
@@ -100,12 +100,10 @@ module MongoMapper
100
100
  end
101
101
  end
102
102
 
103
- require 'mongo_mapper/finder_options'
104
103
  require 'mongo_mapper/support'
105
- require 'mongo_mapper/descendant_appends'
106
-
104
+ require 'mongo_mapper/finder_options'
107
105
  require 'mongo_mapper/dynamic_finder'
108
- require 'mongo_mapper/key'
106
+ require 'mongo_mapper/descendant_appends'
109
107
 
110
108
  require 'mongo_mapper/plugins'
111
109
  require 'mongo_mapper/plugins/associations'
@@ -123,5 +121,5 @@ require 'mongo_mapper/plugins/rails'
123
121
  require 'mongo_mapper/plugins/serialization'
124
122
  require 'mongo_mapper/plugins/validations'
125
123
 
126
- require 'mongo_mapper/embedded_document'
127
- require 'mongo_mapper/document'
124
+ require 'mongo_mapper/document'
125
+ require 'mongo_mapper/embedded_document'
@@ -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
@@ -20,7 +20,7 @@ class FooType < Struct.new(:bar)
20
20
  end
21
21
 
22
22
  class KeyTest < Test::Unit::TestCase
23
- include MongoMapper
23
+ include MongoMapper::Plugins::Keys
24
24
 
25
25
  context "Initializing a new key" do
26
26
  should "allow setting the name" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_mapper-unstable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2010.1.12
4
+ version: 2010.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-12 00:00:00 -05:00
12
+ date: 2010-01-17 00:00:00 -05:00
13
13
  default_executable: mmconsole
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency