djsun-mongomapper 0.3.5 → 0.3.5.1
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.
- data/lib/mongomapper/associations/proxy.rb +10 -0
- data/mongomapper.gemspec +1 -1
- data/test/functional/associations/test_belongs_to_polymorphic_proxy.rb +4 -0
- data/test/functional/associations/test_belongs_to_proxy.rb +4 -0
- data/test/functional/associations/test_many_documents_as_proxy.rb +1 -0
- data/test/functional/associations/test_many_embedded_polymorphic_proxy.rb +4 -4
- data/test/functional/associations/test_many_embedded_proxy.rb +1 -0
- data/test/functional/associations/test_many_polymorphic_proxy.rb +1 -0
- metadata +3 -2
data/mongomapper.gemspec
CHANGED
@@ -9,6 +9,7 @@ class BelongsToPolymorphicProxyTest < Test::Unit::TestCase
|
|
9
9
|
should "default to nil" do
|
10
10
|
status = Status.new
|
11
11
|
status.target.should be_nil
|
12
|
+
status.target.inspect.should == "nil"
|
12
13
|
end
|
13
14
|
|
14
15
|
should "be able to replace the association" do
|
@@ -19,6 +20,7 @@ class BelongsToPolymorphicProxyTest < Test::Unit::TestCase
|
|
19
20
|
|
20
21
|
from_db = Status.find(status.id)
|
21
22
|
from_db.target.should_not be_nil
|
23
|
+
from_db.target.inspect.should_not be_empty
|
22
24
|
from_db.target_id.should == project.id
|
23
25
|
from_db.target_type.should == "Project"
|
24
26
|
from_db.target.name.should == "mongomapper"
|
@@ -35,6 +37,7 @@ class BelongsToPolymorphicProxyTest < Test::Unit::TestCase
|
|
35
37
|
from_db.target_type.should be_nil
|
36
38
|
from_db.target_id.should be_nil
|
37
39
|
from_db.target.should be_nil
|
40
|
+
from_db.target.inspect.should == "nil"
|
38
41
|
end
|
39
42
|
|
40
43
|
context "association id set but document not found" do
|
@@ -48,6 +51,7 @@ class BelongsToPolymorphicProxyTest < Test::Unit::TestCase
|
|
48
51
|
|
49
52
|
should "return nil instead of raising error" do
|
50
53
|
@status.target.should be_nil
|
54
|
+
@status.target.inspect.should == "nil"
|
51
55
|
end
|
52
56
|
end
|
53
57
|
end
|
@@ -9,6 +9,7 @@ class BelongsToProxyTest < Test::Unit::TestCase
|
|
9
9
|
should "default to nil" do
|
10
10
|
status = Status.new
|
11
11
|
status.project.should be_nil
|
12
|
+
status.project.inspect.should == "nil"
|
12
13
|
end
|
13
14
|
|
14
15
|
should "be able to replace the association" do
|
@@ -19,6 +20,7 @@ class BelongsToProxyTest < Test::Unit::TestCase
|
|
19
20
|
|
20
21
|
from_db = Status.find(status.id)
|
21
22
|
from_db.project.should_not be_nil
|
23
|
+
from_db.project.inspect.should_not be_empty
|
22
24
|
from_db.project.name.should == "mongomapper"
|
23
25
|
end
|
24
26
|
|
@@ -31,6 +33,7 @@ class BelongsToProxyTest < Test::Unit::TestCase
|
|
31
33
|
from_db = Status.find(status.id)
|
32
34
|
from_db.project = nil
|
33
35
|
from_db.project.should be_nil
|
36
|
+
from_db.project.inspect.should == "nil"
|
34
37
|
end
|
35
38
|
|
36
39
|
context "association id set but document not found" do
|
@@ -40,6 +43,7 @@ class BelongsToProxyTest < Test::Unit::TestCase
|
|
40
43
|
|
41
44
|
should "return nil instead of raising error" do
|
42
45
|
@status.project.should be_nil
|
46
|
+
@status.project.inspect.should == "nil"
|
43
47
|
end
|
44
48
|
end
|
45
49
|
end
|
@@ -7,8 +7,8 @@ class ManyEmbeddedPolymorphicProxyTest < Test::Unit::TestCase
|
|
7
7
|
end
|
8
8
|
|
9
9
|
should "default reader to empty array" do
|
10
|
-
|
11
|
-
|
10
|
+
Catalog.new.medias.should == []
|
11
|
+
Catalog.new.medias.inspect.should == "[]"
|
12
12
|
end
|
13
13
|
|
14
14
|
should "allow adding to association like it was an array" do
|
@@ -87,8 +87,8 @@ class ManyEmbeddedPolymorphicProxyTest < Test::Unit::TestCase
|
|
87
87
|
end
|
88
88
|
|
89
89
|
should "default reader to empty array" do
|
90
|
-
|
91
|
-
|
90
|
+
TrModels::Fleet.new.transports.should == []
|
91
|
+
TrModels::Fleet.new.transports.inspect.should == "[]"
|
92
92
|
end
|
93
93
|
|
94
94
|
should "allow adding to association like it was an array" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: djsun-mongomapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.5
|
4
|
+
version: 0.3.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- test/unit/test_validations.rb
|
138
138
|
has_rdoc: false
|
139
139
|
homepage: http://github.com/jnunemaker/mongomapper
|
140
|
+
licenses:
|
140
141
|
post_install_message:
|
141
142
|
rdoc_options:
|
142
143
|
- --charset=UTF-8
|
@@ -157,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
158
|
requirements: []
|
158
159
|
|
159
160
|
rubyforge_project: mongomapper
|
160
|
-
rubygems_version: 1.
|
161
|
+
rubygems_version: 1.3.5
|
161
162
|
signing_key:
|
162
163
|
specification_version: 3
|
163
164
|
summary: Awesome gem for modeling your domain and storing it in mongo
|