mongo_mapper 0.13.0.beta2 → 0.15.0
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.
- checksums.yaml +5 -5
- data/LICENSE +1 -1
- data/README.md +64 -0
- data/examples/keys.rb +3 -3
- data/examples/modifiers/set.rb +2 -2
- data/examples/querying.rb +3 -3
- data/examples/safe.rb +2 -2
- data/examples/scopes.rb +1 -1
- data/lib/mongo_mapper.rb +5 -0
- data/lib/mongo_mapper/connection.rb +16 -37
- data/lib/mongo_mapper/document.rb +4 -0
- data/lib/mongo_mapper/extensions/array.rb +14 -6
- data/lib/mongo_mapper/extensions/hash.rb +15 -3
- data/lib/mongo_mapper/extensions/object.rb +4 -0
- data/lib/mongo_mapper/extensions/object_id.rb +5 -1
- data/lib/mongo_mapper/extensions/string.rb +13 -5
- data/lib/mongo_mapper/extensions/symbol.rb +18 -0
- data/lib/mongo_mapper/plugins/accessible.rb +14 -4
- data/lib/mongo_mapper/plugins/associations.rb +7 -6
- data/lib/mongo_mapper/plugins/associations/base.rb +18 -13
- data/lib/mongo_mapper/plugins/associations/belongs_to_association.rb +10 -1
- data/lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb +9 -8
- data/lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb +12 -11
- data/lib/mongo_mapper/plugins/associations/embedded_collection.rb +4 -4
- data/lib/mongo_mapper/plugins/associations/in_array_proxy.rb +24 -23
- data/lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb +18 -16
- data/lib/mongo_mapper/plugins/associations/many_documents_proxy.rb +55 -48
- data/lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb +14 -13
- data/lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb +7 -6
- data/lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb +7 -5
- data/lib/mongo_mapper/plugins/associations/one_as_proxy.rb +17 -14
- data/lib/mongo_mapper/plugins/associations/one_embedded_polymorphic_proxy.rb +14 -13
- data/lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb +9 -9
- data/lib/mongo_mapper/plugins/associations/one_proxy.rb +27 -26
- data/lib/mongo_mapper/plugins/associations/proxy.rb +31 -28
- data/lib/mongo_mapper/plugins/callbacks.rb +14 -1
- data/lib/mongo_mapper/plugins/counter_cache.rb +97 -0
- data/lib/mongo_mapper/plugins/dirty.rb +29 -37
- data/lib/mongo_mapper/plugins/document.rb +1 -1
- data/lib/mongo_mapper/plugins/dynamic_querying.rb +10 -9
- data/lib/mongo_mapper/plugins/dynamic_querying/dynamic_finder.rb +18 -17
- data/lib/mongo_mapper/plugins/embedded_callbacks.rb +2 -1
- data/lib/mongo_mapper/plugins/embedded_document.rb +1 -1
- data/lib/mongo_mapper/plugins/identity_map.rb +1 -1
- data/lib/mongo_mapper/plugins/indexes.rb +37 -2
- data/lib/mongo_mapper/plugins/keys.rb +202 -142
- data/lib/mongo_mapper/plugins/keys/key.rb +22 -13
- data/lib/mongo_mapper/plugins/keys/static.rb +45 -0
- data/lib/mongo_mapper/plugins/modifiers.rb +59 -28
- data/lib/mongo_mapper/plugins/partial_updates.rb +86 -0
- data/lib/mongo_mapper/plugins/persistence.rb +13 -8
- data/lib/mongo_mapper/plugins/protected.rb +6 -5
- data/lib/mongo_mapper/plugins/querying.rb +85 -42
- data/lib/mongo_mapper/plugins/querying/decorated_plucky_query.rb +32 -9
- data/lib/mongo_mapper/plugins/rails.rb +1 -0
- data/lib/mongo_mapper/plugins/safe.rb +10 -4
- data/lib/mongo_mapper/plugins/sci.rb +4 -1
- data/lib/mongo_mapper/plugins/scopes.rb +78 -7
- data/lib/mongo_mapper/plugins/stats.rb +17 -0
- data/lib/mongo_mapper/plugins/timestamps.rb +1 -0
- data/lib/mongo_mapper/plugins/touch.rb +1 -1
- data/lib/mongo_mapper/plugins/validations.rb +7 -2
- data/lib/mongo_mapper/railtie.rb +20 -0
- data/lib/mongo_mapper/railtie/database.rake +1 -1
- data/lib/mongo_mapper/utils.rb +2 -2
- data/lib/mongo_mapper/version.rb +1 -1
- data/lib/rails/generators/mongo_mapper/config/config_generator.rb +12 -13
- data/lib/rails/generators/mongo_mapper/model/model_generator.rb +9 -9
- data/spec/examples.txt +1643 -0
- data/spec/functional/accessible_spec.rb +13 -13
- data/spec/functional/associations/belongs_to_polymorphic_proxy_spec.rb +13 -13
- data/spec/functional/associations/belongs_to_proxy_spec.rb +18 -19
- data/spec/functional/associations/in_array_proxy_spec.rb +10 -10
- data/spec/functional/associations/many_documents_as_proxy_spec.rb +6 -6
- data/spec/functional/associations/many_documents_proxy_spec.rb +85 -14
- data/spec/functional/associations/many_embedded_polymorphic_proxy_spec.rb +13 -13
- data/spec/functional/associations/many_embedded_proxy_spec.rb +1 -1
- data/spec/functional/associations/many_polymorphic_proxy_spec.rb +4 -4
- data/spec/functional/associations/one_as_proxy_spec.rb +10 -10
- data/spec/functional/associations/one_embedded_polymorphic_proxy_spec.rb +9 -9
- data/spec/functional/associations/one_embedded_proxy_spec.rb +3 -3
- data/spec/functional/associations/one_proxy_spec.rb +10 -10
- data/spec/functional/associations_spec.rb +3 -3
- data/spec/functional/binary_spec.rb +2 -2
- data/spec/functional/caching_spec.rb +8 -15
- data/spec/functional/callbacks_spec.rb +89 -2
- data/spec/functional/counter_cache_spec.rb +235 -0
- data/spec/functional/dirty_spec.rb +63 -46
- data/spec/functional/document_spec.rb +30 -2
- data/spec/functional/dumpable_spec.rb +1 -1
- data/spec/functional/embedded_document_spec.rb +18 -18
- data/spec/functional/identity_map_spec.rb +27 -14
- data/spec/functional/indexes_spec.rb +44 -19
- data/spec/functional/keys_spec.rb +117 -15
- data/spec/functional/logger_spec.rb +3 -3
- data/spec/functional/modifiers_spec.rb +67 -19
- data/spec/functional/partial_updates_spec.rb +577 -0
- data/spec/functional/protected_spec.rb +14 -14
- data/spec/functional/querying_spec.rb +55 -28
- data/spec/functional/safe_spec.rb +23 -27
- data/spec/functional/sci_spec.rb +49 -14
- data/spec/functional/scopes_spec.rb +235 -2
- data/spec/functional/static_keys_spec.rb +153 -0
- data/spec/functional/stats_spec.rb +86 -0
- data/spec/functional/touch_spec.rb +6 -6
- data/spec/functional/validations_spec.rb +51 -57
- data/spec/quality_spec.rb +51 -0
- data/spec/spec_helper.rb +37 -9
- data/spec/support/matchers.rb +5 -14
- data/spec/unit/associations/base_spec.rb +12 -12
- data/spec/unit/associations/belongs_to_association_spec.rb +2 -2
- data/spec/unit/associations/many_association_spec.rb +2 -2
- data/spec/unit/associations/one_association_spec.rb +2 -2
- data/spec/unit/associations/proxy_spec.rb +19 -16
- data/spec/unit/clone_spec.rb +1 -1
- data/spec/unit/document_spec.rb +8 -8
- data/spec/unit/dynamic_finder_spec.rb +8 -8
- data/spec/unit/embedded_document_spec.rb +18 -19
- data/spec/unit/extensions_spec.rb +41 -17
- data/spec/unit/identity_map_middleware_spec.rb +65 -96
- data/spec/unit/inspect_spec.rb +4 -4
- data/spec/unit/key_spec.rb +28 -26
- data/spec/unit/keys_spec.rb +10 -10
- data/spec/unit/model_generator_spec.rb +2 -4
- data/spec/unit/mongo_mapper_spec.rb +38 -85
- data/spec/unit/rails_spec.rb +5 -0
- data/spec/unit/serialization_spec.rb +1 -1
- data/spec/unit/time_zones_spec.rb +2 -2
- data/spec/unit/validations_spec.rb +28 -15
- metadata +188 -161
- data/README.rdoc +0 -55
- data/lib/mongo_mapper/extensions/ordered_hash.rb +0 -23
data/spec/unit/keys_spec.rb
CHANGED
@@ -9,18 +9,18 @@ describe "Key" do
|
|
9
9
|
key :_id, Integer
|
10
10
|
end
|
11
11
|
# No sensible default id for integer, people better pass them in if they user this
|
12
|
-
|
12
|
+
suppress_stderr { klass.new.id.should be_nil }
|
13
13
|
}.should_not raise_error
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
context ".key?(:symbol)" do
|
18
18
|
it "should be true if document has key" do
|
19
|
-
Address.key?(:city).should
|
19
|
+
Address.key?(:city).should be_truthy
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should be false if document does not have key" do
|
23
|
-
Address.key?(:foo).should
|
23
|
+
Address.key?(:foo).should be_falsey
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -59,11 +59,11 @@ describe "Key" do
|
|
59
59
|
|
60
60
|
context ".key?('string')" do
|
61
61
|
it "should be true if document has key" do
|
62
|
-
Address.key?('city').should
|
62
|
+
Address.key?('city').should be_truthy
|
63
63
|
end
|
64
64
|
|
65
65
|
it "should be false if document does not have key" do
|
66
|
-
Address.key?('foo').should
|
66
|
+
Address.key?('foo').should be_falsey
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
@@ -82,11 +82,11 @@ describe "Key" do
|
|
82
82
|
end
|
83
83
|
|
84
84
|
it "should use []= for keys instead of public writer" do
|
85
|
-
|
85
|
+
lambda {
|
86
86
|
doc = @klass.first
|
87
87
|
doc.user['id'].should == 1
|
88
88
|
doc.user['name'].should == 'John Nunemaker'
|
89
|
-
}.
|
89
|
+
}.should_not raise_error
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
@@ -141,15 +141,15 @@ describe "Key" do
|
|
141
141
|
key :value, Integer, :default => lambda { counter += 1 }
|
142
142
|
end
|
143
143
|
|
144
|
-
|
145
|
-
|
144
|
+
lambda { instance = klass.create }.should change { counter }.by(1)
|
145
|
+
lambda {
|
146
146
|
instance.reload.value.should == 1
|
147
147
|
|
148
148
|
instance.value = 10
|
149
149
|
instance.save
|
150
150
|
|
151
151
|
instance.reload.value.should == 10
|
152
|
-
}.
|
152
|
+
}.should_not change { counter }
|
153
153
|
end
|
154
154
|
end
|
155
155
|
end # KeyTest
|
@@ -12,10 +12,8 @@ describe MongoMapper::Generators::ModelGenerator do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'help shows MongoMapper options' do
|
15
|
-
|
16
|
-
|
17
|
-
assert_match(/rails generate mongo_mapper:model/, content)
|
18
|
-
end
|
15
|
+
content = run_generator ['--help']
|
16
|
+
assert_match(/rails generate mongo_mapper:model/, content)
|
19
17
|
end
|
20
18
|
|
21
19
|
it 'model are properly created' do
|
@@ -3,23 +3,28 @@ require 'spec_helper'
|
|
3
3
|
class Address; end
|
4
4
|
|
5
5
|
describe "MongoMapper" do
|
6
|
-
it "should be able to write and read connection" do
|
7
|
-
conn = Mongo::
|
6
|
+
it "should be able to write and read connection", :without_connection do
|
7
|
+
conn = Mongo::Client.new(['127.0.0.1:27001'])
|
8
8
|
MongoMapper.connection = conn
|
9
9
|
MongoMapper.connection.should == conn
|
10
10
|
end
|
11
11
|
|
12
|
-
it "should default connection to new mongo ruby driver" do
|
12
|
+
it "should default connection to new mongo ruby driver", :without_connection do
|
13
13
|
MongoMapper.connection = nil
|
14
|
-
MongoMapper.connection.should be_instance_of(Mongo::
|
14
|
+
MongoMapper.connection.should be_instance_of(Mongo::Client)
|
15
15
|
end
|
16
16
|
|
17
|
-
it "should be able to
|
18
|
-
MongoMapper.database
|
19
|
-
MongoMapper.database.should be_instance_of(Mongo::DB)
|
17
|
+
it "should be able to read default database" do
|
18
|
+
MongoMapper.database.should be_instance_of(Mongo::Database)
|
20
19
|
MongoMapper.database.name.should == 'test'
|
21
20
|
end
|
22
21
|
|
22
|
+
it "should be able to write default database", :without_connection do
|
23
|
+
MongoMapper.database = 'test-2'
|
24
|
+
MongoMapper.database.should be_instance_of(Mongo::Database)
|
25
|
+
MongoMapper.database.name.should == 'test-2'
|
26
|
+
end
|
27
|
+
|
23
28
|
it "should have document not found error" do
|
24
29
|
lambda {
|
25
30
|
MongoMapper::DocumentNotFound
|
@@ -35,96 +40,64 @@ describe "MongoMapper" do
|
|
35
40
|
MongoMapper.config.should == config
|
36
41
|
end
|
37
42
|
|
38
|
-
context "connecting to environment from config" do
|
39
|
-
it "should work without authentication" do
|
40
|
-
MongoMapper.config = {
|
41
|
-
'development' => {'host' => '127.0.0.1', 'port' => 27017, 'database' => 'test'}
|
42
|
-
}
|
43
|
-
Mongo::MongoClient.should_receive(:new).with('127.0.0.1', 27017, {})
|
44
|
-
MongoMapper.should_receive(:database=).with('test')
|
45
|
-
Mongo::DB.any_instance.should_receive(:authenticate).never
|
46
|
-
MongoMapper.connect('development')
|
47
|
-
end
|
43
|
+
context "connecting to environment from config", :without_connection do
|
48
44
|
|
49
45
|
it "should work without authentication using uri" do
|
50
46
|
MongoMapper.config = {
|
51
47
|
'development' => {'uri' => 'mongodb://127.0.0.1:27017/test'}
|
52
48
|
}
|
53
|
-
Mongo::
|
54
|
-
MongoMapper.should_receive(:database=).with('test')
|
55
|
-
Mongo::DB.any_instance.should_receive(:authenticate).never
|
49
|
+
Mongo::Client.should_receive(:new).with('mongodb://127.0.0.1:27017/test', {})
|
56
50
|
MongoMapper.connect('development')
|
57
51
|
end
|
58
52
|
|
59
|
-
it "should work
|
53
|
+
it "should work without authentication using hosts" do
|
60
54
|
MongoMapper.config = {
|
61
|
-
'development' => {'
|
55
|
+
'development' => {'hosts' => ['127.0.0.1:27017']}
|
62
56
|
}
|
63
|
-
Mongo::
|
64
|
-
MongoMapper.
|
65
|
-
Mongo::DB.any_instance.should_receive(:authenticate).never
|
66
|
-
MongoMapper.connect(:development)
|
67
|
-
end
|
68
|
-
|
69
|
-
it "should work with options" do
|
70
|
-
MongoMapper.config = {
|
71
|
-
'development' => {'host' => '127.0.0.1', 'port' => 27017, 'database' => 'test'}
|
72
|
-
}
|
73
|
-
connection, logger = double('connection'), double('logger')
|
74
|
-
Mongo::MongoClient.should_receive(:new).with('127.0.0.1', 27017, :logger => logger)
|
75
|
-
MongoMapper.connect('development', :logger => logger)
|
76
|
-
end
|
77
|
-
|
78
|
-
it "should pass along ssl when true" do
|
79
|
-
MongoMapper.config = {
|
80
|
-
'development' => {'host' => '127.0.0.1', 'port' => 27017, 'database' => 'test', 'ssl' => true}
|
81
|
-
}
|
82
|
-
connection, logger = double('connection'), double('logger')
|
83
|
-
Mongo::MongoClient.should_receive(:new).with('127.0.0.1', 27017, :logger => logger, :ssl => true)
|
84
|
-
MongoMapper.connect('development', :logger => logger)
|
57
|
+
Mongo::Client.should_receive(:new).with(['127.0.0.1:27017'], {})
|
58
|
+
MongoMapper.connect('development')
|
85
59
|
end
|
86
60
|
|
87
|
-
it "should
|
61
|
+
it "should work without authentication using host" do
|
88
62
|
MongoMapper.config = {
|
89
|
-
'development' => {'host' => '127.0.0.1
|
63
|
+
'development' => {'host' => '127.0.0.1:27017'}
|
90
64
|
}
|
91
|
-
|
92
|
-
|
93
|
-
MongoMapper.connect('development', :logger => logger)
|
65
|
+
Mongo::Client.should_receive(:new).with(['127.0.0.1:27017'], {})
|
66
|
+
MongoMapper.connect('development')
|
94
67
|
end
|
95
68
|
|
96
69
|
it "should convert read preferences to symbols" do
|
97
70
|
MongoMapper.config = {
|
98
|
-
'development' => {'
|
71
|
+
'development' => {'hosts' => ['127.0.0.1:27017'], 'database' => 'test', 'read' => 'primary'}
|
99
72
|
}
|
100
|
-
|
101
|
-
Mongo::
|
73
|
+
logger = double('logger')
|
74
|
+
Mongo::Client.should_receive(:new).with(['127.0.0.1:27017'], :logger => logger, :read => :primary, :database => 'test')
|
102
75
|
MongoMapper.connect('development', :logger => logger)
|
103
76
|
end
|
104
77
|
|
105
78
|
it "should work with options from config" do
|
106
79
|
MongoMapper.config = {
|
107
|
-
'development' => {'
|
80
|
+
'development' => {'hosts' => ['192.168.1.1:2222'], 'database' => 'test', 'safe' => true}
|
108
81
|
}
|
109
|
-
|
110
|
-
Mongo::
|
82
|
+
logger = double('logger')
|
83
|
+
Mongo::Client.should_receive(:new).with(['192.168.1.1:2222'], :logger => logger, :safe => true, :database => 'test')
|
111
84
|
MongoMapper.connect('development', :logger => logger)
|
112
85
|
end
|
113
86
|
|
114
87
|
it "should work with options using uri" do
|
115
88
|
MongoMapper.config = {
|
116
|
-
'development' => {'uri' => 'mongodb://127.0.0.1:27017/test'}
|
89
|
+
'development' => {'uri' => 'mongodb://127.0.0.1:27017/test', 'options'=> {:foo => 1}}
|
117
90
|
}
|
118
|
-
|
119
|
-
Mongo::
|
91
|
+
logger = double('logger')
|
92
|
+
Mongo::Client.should_receive(:new).with('mongodb://127.0.0.1:27017/test', :logger => logger, :foo => 1)
|
120
93
|
MongoMapper.connect('development', :logger => logger)
|
121
94
|
end
|
122
95
|
|
123
96
|
it "should work with authentication" do
|
124
97
|
MongoMapper.config = {
|
125
|
-
'development' => {'
|
98
|
+
'development' => {'hosts' => ['127.0.0.1:27017'], 'database' => 'test', 'user' => 'john', 'password' => 'secret'}
|
126
99
|
}
|
127
|
-
Mongo::
|
100
|
+
Mongo::Client.should_receive(:new).with(['127.0.0.1:27017'], :database => 'test', :user => 'john', :password => 'secret')
|
128
101
|
MongoMapper.connect('development')
|
129
102
|
end
|
130
103
|
|
@@ -132,7 +105,7 @@ describe "MongoMapper" do
|
|
132
105
|
MongoMapper.config = {
|
133
106
|
'development' => {'uri' => 'mongodb://john:secret@127.0.0.1:27017/test'}
|
134
107
|
}
|
135
|
-
Mongo::
|
108
|
+
Mongo::Client.should_receive(:new).with('mongodb://john:secret@127.0.0.1:27017/test', {})
|
136
109
|
MongoMapper.connect('development')
|
137
110
|
end
|
138
111
|
|
@@ -140,36 +113,16 @@ describe "MongoMapper" do
|
|
140
113
|
MongoMapper.config = {
|
141
114
|
'development' => {'uri' => 'mysql://127.0.0.1:5336/foo'}
|
142
115
|
}
|
143
|
-
|
116
|
+
lambda { MongoMapper.connect('development') }.should raise_error(Mongo::Error::InvalidURI)
|
144
117
|
end
|
145
118
|
|
146
|
-
it
|
119
|
+
it 'should forbid use of port' do
|
147
120
|
MongoMapper.config = {
|
148
|
-
'development' => {
|
149
|
-
'hosts' => [ ['127.0.0.1', 27017], ['localhost', 27017] ],
|
150
|
-
'database' => 'test'
|
151
|
-
}
|
121
|
+
'development' => {'host' => '192.168.1.1', 'port' => '27017', 'database' => 'test', 'safe' => true}
|
152
122
|
}
|
153
|
-
|
154
|
-
Mongo::MongoReplicaSetClient.should_receive(:new).with( ['127.0.0.1', 27017], ['localhost', 27017], {'read_secondary' => true} )
|
155
|
-
MongoMapper.should_receive(:database=).with('test')
|
156
|
-
Mongo::DB.any_instance.should_receive(:authenticate).never
|
157
|
-
MongoMapper.connect('development', 'read_secondary' => true)
|
123
|
+
lambda { MongoMapper.connect('development') }.should raise_error(RuntimeError)
|
158
124
|
end
|
159
125
|
|
160
|
-
it "should create a replica set connection if config contains multiple hosts in the new format" do
|
161
|
-
MongoMapper.config = {
|
162
|
-
'development' => {
|
163
|
-
'hosts' => ['127.0.0.1:27017', 'localhost:27017'],
|
164
|
-
'database' => 'test'
|
165
|
-
}
|
166
|
-
}
|
167
|
-
|
168
|
-
Mongo::MongoReplicaSetClient.should_receive(:new).with( ['127.0.0.1:27017', 'localhost:27017'], {'read_secondary' => true} )
|
169
|
-
MongoMapper.should_receive(:database=).with('test')
|
170
|
-
Mongo::DB.any_instance.should_receive(:authenticate).never
|
171
|
-
MongoMapper.connect('development', 'read_secondary' => true)
|
172
|
-
end
|
173
126
|
end
|
174
127
|
|
175
128
|
context "setup" do
|
data/spec/unit/rails_spec.rb
CHANGED
@@ -66,6 +66,11 @@ describe "Rails integration" do
|
|
66
66
|
@klass.new(:bar => 'Setting Foo').foo.should == 'Setting Foo'
|
67
67
|
end
|
68
68
|
|
69
|
+
it "should return the type casted value from write attribute" do
|
70
|
+
obj = @klass.new
|
71
|
+
obj.write_attribute(:foo, true).should == "true"
|
72
|
+
end
|
73
|
+
|
69
74
|
context '#to_param' do
|
70
75
|
it "should be nil if not persisted" do
|
71
76
|
@klass.new.tap do |doc|
|
@@ -151,7 +151,7 @@ module Serialization
|
|
151
151
|
|
152
152
|
@instance.name.should == unserialized.name
|
153
153
|
@instance.age.should == unserialized.age
|
154
|
-
unserialized.awesome.should
|
154
|
+
unserialized.awesome.should be_falsey
|
155
155
|
unserialized.created_at.should be_nil
|
156
156
|
end
|
157
157
|
|
@@ -25,7 +25,7 @@ describe "TimeZones" do
|
|
25
25
|
Time.zone = 'UTC'
|
26
26
|
|
27
27
|
doc = @document.new(:created_at => "2009-08-15 14:00:00")
|
28
|
-
doc.created_at.is_a?(ActiveSupport::TimeWithZone).should
|
28
|
+
doc.created_at.is_a?(ActiveSupport::TimeWithZone).should be_truthy
|
29
29
|
doc.created_at.should == Time.utc(2009, 8, 15, 14)
|
30
30
|
|
31
31
|
Time.zone = nil
|
@@ -35,7 +35,7 @@ describe "TimeZones" do
|
|
35
35
|
Time.zone = 'Hawaii'
|
36
36
|
|
37
37
|
doc = @document.new(:created_at => "2009-08-15 14:00:00")
|
38
|
-
doc.created_at.is_a?(ActiveSupport::TimeWithZone).should
|
38
|
+
doc.created_at.is_a?(ActiveSupport::TimeWithZone).should be_truthy
|
39
39
|
doc.created_at.should == Time.utc(2009, 8, 16)
|
40
40
|
|
41
41
|
Time.zone = nil
|
@@ -27,7 +27,7 @@ describe "Validations" do
|
|
27
27
|
doc = @document.new
|
28
28
|
doc.password = 'foobar'
|
29
29
|
doc.password_confirmation = 'foobar1'
|
30
|
-
doc.should have_error_on(:
|
30
|
+
doc.should have_error_on(:password).or(have_error_on(:password_confirmation))
|
31
31
|
|
32
32
|
doc.password_confirmation = 'foobar'
|
33
33
|
doc.should_not have_error_on(:password)
|
@@ -190,7 +190,8 @@ describe "Validations" do
|
|
190
190
|
doc.should_not have_error_on(:action)
|
191
191
|
|
192
192
|
doc.action = 'kick'
|
193
|
-
doc.should have_error_on(:action
|
193
|
+
doc.should have_error_on(:action)
|
194
|
+
doc.errors[:action].should == ['is reserved']
|
194
195
|
end
|
195
196
|
|
196
197
|
it "should work with :not_in shortcut on key definition" do
|
@@ -203,7 +204,8 @@ describe "Validations" do
|
|
203
204
|
doc.should_not have_error_on(:action)
|
204
205
|
|
205
206
|
doc.action = 'kick'
|
206
|
-
doc.should have_error_on(:action
|
207
|
+
doc.should have_error_on(:action)
|
208
|
+
doc.errors[:action].should == ['is reserved']
|
207
209
|
end
|
208
210
|
|
209
211
|
it "should not have error if allow nil is true and value is nil" do
|
@@ -236,10 +238,12 @@ describe "Validations" do
|
|
236
238
|
@document.validates_inclusion_of :action, :in => %w(kick run)
|
237
239
|
|
238
240
|
doc = @document.new
|
239
|
-
doc.should have_error_on(:action
|
241
|
+
doc.should have_error_on(:action)
|
242
|
+
doc.errors[:action].should == ['is not included in the list']
|
240
243
|
|
241
244
|
doc.action = 'fart'
|
242
|
-
doc.should have_error_on(:action
|
245
|
+
doc.should have_error_on(:action)
|
246
|
+
doc.errors[:action].should == ['is not included in the list']
|
243
247
|
|
244
248
|
doc.action = 'kick'
|
245
249
|
doc.should_not have_error_on(:action)
|
@@ -249,10 +253,12 @@ describe "Validations" do
|
|
249
253
|
@document.key :action, String, :in => %w(kick run)
|
250
254
|
|
251
255
|
doc = @document.new
|
252
|
-
doc.should have_error_on(:action
|
256
|
+
doc.should have_error_on(:action)
|
257
|
+
doc.errors[:action].should == ['is not included in the list']
|
253
258
|
|
254
259
|
doc.action = 'fart'
|
255
|
-
doc.should have_error_on(:action
|
260
|
+
doc.should have_error_on(:action)
|
261
|
+
doc.errors[:action].should == ['is not included in the list']
|
256
262
|
|
257
263
|
doc.action = 'kick'
|
258
264
|
doc.should_not have_error_on(:action)
|
@@ -262,7 +268,8 @@ describe "Validations" do
|
|
262
268
|
@document.key :flag, Boolean, :required => true
|
263
269
|
|
264
270
|
doc = @document.new
|
265
|
-
doc.should have_error_on(:flag
|
271
|
+
doc.should have_error_on(:flag)
|
272
|
+
doc.errors[:flag].should == ['is not included in the list']
|
266
273
|
|
267
274
|
doc.flag = true
|
268
275
|
doc.should_not have_error_on(:action)
|
@@ -313,7 +320,7 @@ describe "Validations" do
|
|
313
320
|
doc = @embedded_doc.new
|
314
321
|
doc.password = 'foobar'
|
315
322
|
doc.password_confirmation = 'foobar1'
|
316
|
-
doc.should have_error_on(:password).or(:password_confirmation)
|
323
|
+
doc.should have_error_on(:password).or(have_error_on(:password_confirmation))
|
317
324
|
doc.password_confirmation = 'foobar'
|
318
325
|
doc.should_not have_error_on(:password)
|
319
326
|
end
|
@@ -462,7 +469,8 @@ describe "Validations" do
|
|
462
469
|
doc.should_not have_error_on(:action)
|
463
470
|
|
464
471
|
doc.action = 'kick'
|
465
|
-
doc.should have_error_on(:action
|
472
|
+
doc.should have_error_on(:action)
|
473
|
+
doc.errors[:action].should == ['is reserved']
|
466
474
|
end
|
467
475
|
|
468
476
|
it "should work with :not_in shortcut on key definition" do
|
@@ -475,7 +483,8 @@ describe "Validations" do
|
|
475
483
|
doc.should_not have_error_on(:action)
|
476
484
|
|
477
485
|
doc.action = 'kick'
|
478
|
-
doc.should have_error_on(:action
|
486
|
+
doc.should have_error_on(:action)
|
487
|
+
doc.errors[:action].should == ['is reserved']
|
479
488
|
end
|
480
489
|
|
481
490
|
it "should not have error if allow nil is true and value is nil" do
|
@@ -508,10 +517,12 @@ describe "Validations" do
|
|
508
517
|
@embedded_doc.validates_inclusion_of :action, :in => %w(kick run)
|
509
518
|
|
510
519
|
doc = @embedded_doc.new
|
511
|
-
doc.should have_error_on(:action
|
520
|
+
doc.should have_error_on(:action)
|
521
|
+
doc.errors[:action].should == ['is not included in the list']
|
512
522
|
|
513
523
|
doc.action = 'fart'
|
514
|
-
doc.should have_error_on(:action
|
524
|
+
doc.should have_error_on(:action)
|
525
|
+
doc.errors[:action].should == ['is not included in the list']
|
515
526
|
|
516
527
|
doc.action = 'kick'
|
517
528
|
doc.should_not have_error_on(:action)
|
@@ -521,10 +532,12 @@ describe "Validations" do
|
|
521
532
|
@embedded_doc.key :action, String, :in => %w(kick run)
|
522
533
|
|
523
534
|
doc = @embedded_doc.new
|
524
|
-
doc.should have_error_on(:action
|
535
|
+
doc.should have_error_on(:action)
|
536
|
+
doc.errors[:action].should == ['is not included in the list']
|
525
537
|
|
526
538
|
doc.action = 'fart'
|
527
|
-
doc.should have_error_on(:action
|
539
|
+
doc.should have_error_on(:action)
|
540
|
+
doc.errors[:action].should == ['is not included in the list']
|
528
541
|
|
529
542
|
doc.action = 'kick'
|
530
543
|
doc.should_not have_error_on(:action)
|
metadata
CHANGED
@@ -1,279 +1,306 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
|
-
|
8
|
+
- Chris Heald
|
9
|
+
- Scott Taylor
|
10
|
+
autorequire:
|
9
11
|
bindir: bin
|
10
12
|
cert_chain: []
|
11
|
-
date:
|
13
|
+
date: 2020-09-15 00:00:00.000000000 Z
|
12
14
|
dependencies:
|
13
15
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
16
|
+
name: mongo
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - "~>"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '2.0'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: plucky
|
15
31
|
requirement: !ruby/object:Gem::Requirement
|
16
32
|
requirements:
|
17
|
-
- -
|
33
|
+
- - "~>"
|
18
34
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
35
|
+
version: 0.8.0
|
20
36
|
type: :runtime
|
21
37
|
prerelease: false
|
22
38
|
version_requirements: !ruby/object:Gem::Requirement
|
23
39
|
requirements:
|
24
|
-
- -
|
40
|
+
- - "~>"
|
25
41
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
42
|
+
version: 0.8.0
|
27
43
|
- !ruby/object:Gem::Dependency
|
28
44
|
name: activesupport
|
29
45
|
requirement: !ruby/object:Gem::Requirement
|
30
46
|
requirements:
|
31
|
-
- -
|
47
|
+
- - ">="
|
32
48
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
49
|
+
version: '5.0'
|
34
50
|
type: :runtime
|
35
51
|
prerelease: false
|
36
52
|
version_requirements: !ruby/object:Gem::Requirement
|
37
53
|
requirements:
|
38
|
-
- -
|
54
|
+
- - ">="
|
39
55
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
56
|
+
version: '5.0'
|
41
57
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
58
|
+
name: activemodel
|
43
59
|
requirement: !ruby/object:Gem::Requirement
|
44
60
|
requirements:
|
45
|
-
- -
|
61
|
+
- - ">="
|
46
62
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
63
|
+
version: '5.0'
|
48
64
|
type: :runtime
|
49
65
|
prerelease: false
|
50
66
|
version_requirements: !ruby/object:Gem::Requirement
|
51
67
|
requirements:
|
52
|
-
- -
|
68
|
+
- - ">="
|
53
69
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
70
|
+
version: '5.0'
|
55
71
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
72
|
+
name: activemodel-serializers-xml
|
57
73
|
requirement: !ruby/object:Gem::Requirement
|
58
74
|
requirements:
|
59
|
-
- - ~>
|
75
|
+
- - "~>"
|
60
76
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
77
|
+
version: '1.0'
|
62
78
|
type: :runtime
|
63
79
|
prerelease: false
|
64
80
|
version_requirements: !ruby/object:Gem::Requirement
|
65
81
|
requirements:
|
66
|
-
- - ~>
|
82
|
+
- - "~>"
|
67
83
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
84
|
+
version: '1.0'
|
69
85
|
description: MongoMapper is a Object-Document Mapper for Ruby and Rails
|
70
86
|
email:
|
71
87
|
- nunemaker@gmail.com
|
88
|
+
- cheald@gmail.com
|
89
|
+
- scott@railsnewbie.com
|
72
90
|
executables:
|
73
91
|
- mmconsole
|
74
92
|
extensions: []
|
75
93
|
extra_rdoc_files: []
|
76
94
|
files:
|
95
|
+
- LICENSE
|
96
|
+
- README.md
|
97
|
+
- UPGRADES
|
77
98
|
- bin/mmconsole
|
78
|
-
- examples/
|
99
|
+
- examples/attr_accessible.rb
|
100
|
+
- examples/attr_protected.rb
|
101
|
+
- examples/cache_key.rb
|
79
102
|
- examples/custom_types.rb
|
80
|
-
- examples/
|
103
|
+
- examples/identity_map.rb
|
104
|
+
- examples/identity_map/automatic.rb
|
81
105
|
- examples/keys.rb
|
82
|
-
- examples/
|
83
|
-
- examples/scopes.rb
|
106
|
+
- examples/modifiers/set.rb
|
84
107
|
- examples/plugins.rb
|
85
|
-
- examples/attr_protected.rb
|
86
108
|
- examples/querying.rb
|
87
|
-
- examples/identity_map/automatic.rb
|
88
|
-
- examples/validating/embedded_docs.rb
|
89
109
|
- examples/safe.rb
|
90
|
-
- examples/
|
110
|
+
- examples/scopes.rb
|
111
|
+
- examples/validating/embedded_docs.rb
|
91
112
|
- lib/mongo_mapper.rb
|
92
|
-
- lib/rails/generators/mongo_mapper/model/model_generator.rb
|
93
|
-
- lib/rails/generators/mongo_mapper/model/templates/model.rb
|
94
|
-
- lib/rails/generators/mongo_mapper/config/config_generator.rb
|
95
|
-
- lib/rails/generators/mongo_mapper/config/templates/mongo.yml
|
96
|
-
- lib/mongo_mapper/railtie.rb
|
97
|
-
- lib/mongo_mapper/embedded_document.rb
|
98
113
|
- lib/mongo_mapper/connection.rb
|
99
|
-
- lib/mongo_mapper/
|
100
|
-
- lib/mongo_mapper/
|
101
|
-
- lib/mongo_mapper/
|
102
|
-
- lib/mongo_mapper/
|
103
|
-
- lib/mongo_mapper/
|
104
|
-
- lib/mongo_mapper/
|
105
|
-
- lib/mongo_mapper/
|
106
|
-
- lib/mongo_mapper/
|
107
|
-
- lib/mongo_mapper/
|
108
|
-
- lib/mongo_mapper/
|
109
|
-
- lib/mongo_mapper/
|
114
|
+
- lib/mongo_mapper/document.rb
|
115
|
+
- lib/mongo_mapper/embedded_document.rb
|
116
|
+
- lib/mongo_mapper/exceptions.rb
|
117
|
+
- lib/mongo_mapper/extensions/array.rb
|
118
|
+
- lib/mongo_mapper/extensions/binary.rb
|
119
|
+
- lib/mongo_mapper/extensions/boolean.rb
|
120
|
+
- lib/mongo_mapper/extensions/date.rb
|
121
|
+
- lib/mongo_mapper/extensions/float.rb
|
122
|
+
- lib/mongo_mapper/extensions/hash.rb
|
123
|
+
- lib/mongo_mapper/extensions/integer.rb
|
124
|
+
- lib/mongo_mapper/extensions/kernel.rb
|
125
|
+
- lib/mongo_mapper/extensions/nil_class.rb
|
126
|
+
- lib/mongo_mapper/extensions/object.rb
|
127
|
+
- lib/mongo_mapper/extensions/object_id.rb
|
128
|
+
- lib/mongo_mapper/extensions/set.rb
|
129
|
+
- lib/mongo_mapper/extensions/string.rb
|
130
|
+
- lib/mongo_mapper/extensions/symbol.rb
|
131
|
+
- lib/mongo_mapper/extensions/time.rb
|
132
|
+
- lib/mongo_mapper/locale/en.yml
|
133
|
+
- lib/mongo_mapper/middleware/identity_map.rb
|
134
|
+
- lib/mongo_mapper/plugins.rb
|
135
|
+
- lib/mongo_mapper/plugins/accessible.rb
|
136
|
+
- lib/mongo_mapper/plugins/active_model.rb
|
137
|
+
- lib/mongo_mapper/plugins/associations.rb
|
138
|
+
- lib/mongo_mapper/plugins/associations/base.rb
|
139
|
+
- lib/mongo_mapper/plugins/associations/belongs_to_association.rb
|
110
140
|
- lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb
|
111
|
-
- lib/mongo_mapper/plugins/associations/
|
112
|
-
- lib/mongo_mapper/plugins/associations/
|
113
|
-
- lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb
|
114
|
-
- lib/mongo_mapper/plugins/associations/one_proxy.rb
|
115
|
-
- lib/mongo_mapper/plugins/associations/one_as_proxy.rb
|
116
|
-
- lib/mongo_mapper/plugins/associations/many_documents_proxy.rb
|
117
|
-
- lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb
|
141
|
+
- lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb
|
142
|
+
- lib/mongo_mapper/plugins/associations/collection.rb
|
118
143
|
- lib/mongo_mapper/plugins/associations/embedded_collection.rb
|
119
|
-
- lib/mongo_mapper/plugins/associations/base.rb
|
120
144
|
- lib/mongo_mapper/plugins/associations/in_array_proxy.rb
|
121
|
-
- lib/mongo_mapper/plugins/associations/
|
122
|
-
- lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb
|
123
|
-
- lib/mongo_mapper/plugins/associations/collection.rb
|
124
|
-
- lib/mongo_mapper/plugins/associations/belongs_to_association.rb
|
145
|
+
- lib/mongo_mapper/plugins/associations/many_association.rb
|
125
146
|
- lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb
|
126
|
-
- lib/mongo_mapper/plugins/associations/
|
147
|
+
- lib/mongo_mapper/plugins/associations/many_documents_proxy.rb
|
148
|
+
- lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb
|
149
|
+
- lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
|
150
|
+
- lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb
|
151
|
+
- lib/mongo_mapper/plugins/associations/one_as_proxy.rb
|
127
152
|
- lib/mongo_mapper/plugins/associations/one_association.rb
|
128
153
|
- lib/mongo_mapper/plugins/associations/one_embedded_polymorphic_proxy.rb
|
154
|
+
- lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb
|
155
|
+
- lib/mongo_mapper/plugins/associations/one_proxy.rb
|
156
|
+
- lib/mongo_mapper/plugins/associations/proxy.rb
|
157
|
+
- lib/mongo_mapper/plugins/associations/single_association.rb
|
158
|
+
- lib/mongo_mapper/plugins/caching.rb
|
159
|
+
- lib/mongo_mapper/plugins/callbacks.rb
|
160
|
+
- lib/mongo_mapper/plugins/clone.rb
|
161
|
+
- lib/mongo_mapper/plugins/counter_cache.rb
|
162
|
+
- lib/mongo_mapper/plugins/dirty.rb
|
163
|
+
- lib/mongo_mapper/plugins/document.rb
|
164
|
+
- lib/mongo_mapper/plugins/dumpable.rb
|
129
165
|
- lib/mongo_mapper/plugins/dynamic_querying.rb
|
166
|
+
- lib/mongo_mapper/plugins/dynamic_querying/dynamic_finder.rb
|
167
|
+
- lib/mongo_mapper/plugins/embedded_callbacks.rb
|
168
|
+
- lib/mongo_mapper/plugins/embedded_document.rb
|
130
169
|
- lib/mongo_mapper/plugins/equality.rb
|
170
|
+
- lib/mongo_mapper/plugins/identity_map.rb
|
131
171
|
- lib/mongo_mapper/plugins/indexes.rb
|
132
|
-
- lib/mongo_mapper/plugins/
|
133
|
-
- lib/mongo_mapper/plugins/
|
172
|
+
- lib/mongo_mapper/plugins/inspect.rb
|
173
|
+
- lib/mongo_mapper/plugins/keys.rb
|
174
|
+
- lib/mongo_mapper/plugins/keys/key.rb
|
175
|
+
- lib/mongo_mapper/plugins/keys/static.rb
|
134
176
|
- lib/mongo_mapper/plugins/logger.rb
|
177
|
+
- lib/mongo_mapper/plugins/modifiers.rb
|
178
|
+
- lib/mongo_mapper/plugins/pagination.rb
|
179
|
+
- lib/mongo_mapper/plugins/partial_updates.rb
|
180
|
+
- lib/mongo_mapper/plugins/persistence.rb
|
181
|
+
- lib/mongo_mapper/plugins/protected.rb
|
182
|
+
- lib/mongo_mapper/plugins/querying.rb
|
135
183
|
- lib/mongo_mapper/plugins/querying/decorated_plucky_query.rb
|
136
|
-
- lib/mongo_mapper/plugins/
|
137
|
-
- lib/mongo_mapper/plugins/accessible.rb
|
138
|
-
- lib/mongo_mapper/plugins/sci.rb
|
139
|
-
- lib/mongo_mapper/plugins/dynamic_querying/dynamic_finder.rb
|
140
|
-
- lib/mongo_mapper/plugins/clone.rb
|
141
|
-
- lib/mongo_mapper/plugins/embedded_callbacks.rb
|
184
|
+
- lib/mongo_mapper/plugins/rails.rb
|
142
185
|
- lib/mongo_mapper/plugins/rails/active_record_association_adapter.rb
|
143
|
-
- lib/mongo_mapper/plugins/keys/key.rb
|
144
|
-
- lib/mongo_mapper/plugins/querying.rb
|
145
|
-
- lib/mongo_mapper/plugins/serialization.rb
|
146
|
-
- lib/mongo_mapper/plugins/dirty.rb
|
147
|
-
- lib/mongo_mapper/plugins/associations.rb
|
148
|
-
- lib/mongo_mapper/plugins/callbacks.rb
|
149
|
-
- lib/mongo_mapper/plugins/pagination.rb
|
150
|
-
- lib/mongo_mapper/plugins/document.rb
|
151
|
-
- lib/mongo_mapper/plugins/validations.rb
|
152
186
|
- lib/mongo_mapper/plugins/safe.rb
|
187
|
+
- lib/mongo_mapper/plugins/sci.rb
|
188
|
+
- lib/mongo_mapper/plugins/scopes.rb
|
189
|
+
- lib/mongo_mapper/plugins/serialization.rb
|
190
|
+
- lib/mongo_mapper/plugins/stats.rb
|
153
191
|
- lib/mongo_mapper/plugins/timestamps.rb
|
154
|
-
- lib/mongo_mapper/plugins/
|
155
|
-
- lib/mongo_mapper/plugins/
|
156
|
-
- lib/mongo_mapper/
|
157
|
-
- lib/mongo_mapper/
|
158
|
-
- lib/mongo_mapper/extensions/integer.rb
|
159
|
-
- lib/mongo_mapper/extensions/time.rb
|
160
|
-
- lib/mongo_mapper/extensions/hash.rb
|
161
|
-
- lib/mongo_mapper/extensions/boolean.rb
|
162
|
-
- lib/mongo_mapper/extensions/array.rb
|
163
|
-
- lib/mongo_mapper/extensions/nil_class.rb
|
164
|
-
- lib/mongo_mapper/extensions/ordered_hash.rb
|
165
|
-
- lib/mongo_mapper/extensions/kernel.rb
|
166
|
-
- lib/mongo_mapper/extensions/string.rb
|
167
|
-
- lib/mongo_mapper/extensions/set.rb
|
168
|
-
- lib/mongo_mapper/extensions/float.rb
|
169
|
-
- lib/mongo_mapper/extensions/binary.rb
|
170
|
-
- lib/mongo_mapper/extensions/date.rb
|
171
|
-
- lib/mongo_mapper/version.rb
|
172
|
-
- lib/mongo_mapper/plugins.rb
|
173
|
-
- lib/mongo_mapper/middleware/identity_map.rb
|
192
|
+
- lib/mongo_mapper/plugins/touch.rb
|
193
|
+
- lib/mongo_mapper/plugins/userstamps.rb
|
194
|
+
- lib/mongo_mapper/plugins/validations.rb
|
195
|
+
- lib/mongo_mapper/railtie.rb
|
174
196
|
- lib/mongo_mapper/railtie/database.rake
|
175
|
-
- lib/mongo_mapper/exceptions.rb
|
176
|
-
- lib/mongo_mapper/locale/en.yml
|
177
|
-
- lib/mongo_mapper/document.rb
|
178
197
|
- lib/mongo_mapper/translation.rb
|
179
|
-
-
|
180
|
-
-
|
181
|
-
-
|
182
|
-
-
|
183
|
-
-
|
184
|
-
-
|
185
|
-
- spec/
|
198
|
+
- lib/mongo_mapper/utils.rb
|
199
|
+
- lib/mongo_mapper/version.rb
|
200
|
+
- lib/rails/generators/mongo_mapper/config/config_generator.rb
|
201
|
+
- lib/rails/generators/mongo_mapper/config/templates/mongo.yml
|
202
|
+
- lib/rails/generators/mongo_mapper/model/model_generator.rb
|
203
|
+
- lib/rails/generators/mongo_mapper/model/templates/model.rb
|
204
|
+
- spec/examples.txt
|
205
|
+
- spec/functional/accessible_spec.rb
|
206
|
+
- spec/functional/associations/belongs_to_polymorphic_proxy_spec.rb
|
186
207
|
- spec/functional/associations/belongs_to_proxy_spec.rb
|
208
|
+
- spec/functional/associations/in_array_proxy_spec.rb
|
187
209
|
- spec/functional/associations/many_documents_as_proxy_spec.rb
|
188
|
-
- spec/functional/associations/many_embedded_proxy_spec.rb
|
189
210
|
- spec/functional/associations/many_documents_proxy_spec.rb
|
190
|
-
- spec/functional/associations/one_proxy_spec.rb
|
191
|
-
- spec/functional/associations/one_embedded_proxy_spec.rb
|
192
211
|
- spec/functional/associations/many_embedded_polymorphic_proxy_spec.rb
|
193
|
-
- spec/functional/associations/
|
212
|
+
- spec/functional/associations/many_embedded_proxy_spec.rb
|
213
|
+
- spec/functional/associations/many_polymorphic_proxy_spec.rb
|
214
|
+
- spec/functional/associations/one_as_proxy_spec.rb
|
194
215
|
- spec/functional/associations/one_embedded_polymorphic_proxy_spec.rb
|
195
|
-
- spec/functional/
|
196
|
-
- spec/functional/
|
197
|
-
- spec/functional/
|
216
|
+
- spec/functional/associations/one_embedded_proxy_spec.rb
|
217
|
+
- spec/functional/associations/one_proxy_spec.rb
|
218
|
+
- spec/functional/associations_spec.rb
|
219
|
+
- spec/functional/binary_spec.rb
|
220
|
+
- spec/functional/caching_spec.rb
|
221
|
+
- spec/functional/callbacks_spec.rb
|
222
|
+
- spec/functional/counter_cache_spec.rb
|
223
|
+
- spec/functional/dirty_spec.rb
|
224
|
+
- spec/functional/document_spec.rb
|
198
225
|
- spec/functional/dumpable_spec.rb
|
199
|
-
- spec/functional/protected_spec.rb
|
200
|
-
- spec/functional/modifiers_spec.rb
|
201
|
-
- spec/functional/pagination_spec.rb
|
202
|
-
- spec/functional/validations_spec.rb
|
203
226
|
- spec/functional/dynamic_querying_spec.rb
|
227
|
+
- spec/functional/embedded_document_spec.rb
|
204
228
|
- spec/functional/equality_spec.rb
|
205
|
-
- spec/functional/callbacks_spec.rb
|
206
229
|
- spec/functional/extensions_spec.rb
|
230
|
+
- spec/functional/identity_map_spec.rb
|
231
|
+
- spec/functional/indexes_spec.rb
|
232
|
+
- spec/functional/keys_spec.rb
|
233
|
+
- spec/functional/logger_spec.rb
|
234
|
+
- spec/functional/modifiers_spec.rb
|
235
|
+
- spec/functional/pagination_spec.rb
|
236
|
+
- spec/functional/partial_updates_spec.rb
|
237
|
+
- spec/functional/protected_spec.rb
|
207
238
|
- spec/functional/querying_spec.rb
|
239
|
+
- spec/functional/rails_spec.rb
|
240
|
+
- spec/functional/safe_spec.rb
|
241
|
+
- spec/functional/sci_spec.rb
|
208
242
|
- spec/functional/scopes_spec.rb
|
209
|
-
- spec/functional/
|
210
|
-
- spec/functional/
|
243
|
+
- spec/functional/static_keys_spec.rb
|
244
|
+
- spec/functional/stats_spec.rb
|
211
245
|
- spec/functional/timestamps_spec.rb
|
212
|
-
- spec/functional/
|
213
|
-
- spec/functional/
|
214
|
-
- spec/functional/
|
215
|
-
- spec/
|
216
|
-
- spec/
|
217
|
-
- spec/
|
218
|
-
- spec/
|
219
|
-
- spec/unit/rails_compatibility_spec.rb
|
220
|
-
- spec/unit/rails_spec.rb
|
221
|
-
- spec/unit/key_spec.rb
|
222
|
-
- spec/unit/clone_spec.rb
|
223
|
-
- spec/unit/associations/many_association_spec.rb
|
224
|
-
- spec/unit/associations/one_association_spec.rb
|
246
|
+
- spec/functional/touch_spec.rb
|
247
|
+
- spec/functional/userstamps_spec.rb
|
248
|
+
- spec/functional/validations_spec.rb
|
249
|
+
- spec/quality_spec.rb
|
250
|
+
- spec/spec_helper.rb
|
251
|
+
- spec/support/matchers.rb
|
252
|
+
- spec/support/models.rb
|
225
253
|
- spec/unit/associations/base_spec.rb
|
226
254
|
- spec/unit/associations/belongs_to_association_spec.rb
|
255
|
+
- spec/unit/associations/many_association_spec.rb
|
256
|
+
- spec/unit/associations/one_association_spec.rb
|
227
257
|
- spec/unit/associations/proxy_spec.rb
|
228
|
-
- spec/unit/
|
229
|
-
- spec/unit/serialization_spec.rb
|
230
|
-
- spec/unit/plugins_spec.rb
|
231
|
-
- spec/unit/pagination_spec.rb
|
232
|
-
- spec/unit/validations_spec.rb
|
233
|
-
- spec/unit/equality_spec.rb
|
258
|
+
- spec/unit/clone_spec.rb
|
234
259
|
- spec/unit/config_generator_spec.rb
|
235
|
-
- spec/unit/extensions_spec.rb
|
236
|
-
- spec/unit/rails_reflect_on_association_spec.rb
|
237
|
-
- spec/unit/exceptions_spec.rb
|
238
|
-
- spec/unit/identity_map_middleware_spec.rb
|
239
|
-
- spec/unit/translation_spec.rb
|
240
|
-
- spec/unit/time_zones_spec.rb
|
241
260
|
- spec/unit/document_spec.rb
|
242
|
-
- spec/unit/
|
261
|
+
- spec/unit/dynamic_finder_spec.rb
|
243
262
|
- spec/unit/embedded_document_spec.rb
|
263
|
+
- spec/unit/equality_spec.rb
|
264
|
+
- spec/unit/exceptions_spec.rb
|
265
|
+
- spec/unit/extensions_spec.rb
|
266
|
+
- spec/unit/identity_map_middleware_spec.rb
|
244
267
|
- spec/unit/inspect_spec.rb
|
268
|
+
- spec/unit/key_spec.rb
|
245
269
|
- spec/unit/keys_spec.rb
|
270
|
+
- spec/unit/model_generator_spec.rb
|
271
|
+
- spec/unit/mongo_mapper_spec.rb
|
272
|
+
- spec/unit/pagination_spec.rb
|
273
|
+
- spec/unit/plugins_spec.rb
|
274
|
+
- spec/unit/rails_compatibility_spec.rb
|
275
|
+
- spec/unit/rails_reflect_on_association_spec.rb
|
276
|
+
- spec/unit/rails_spec.rb
|
277
|
+
- spec/unit/serialization_spec.rb
|
246
278
|
- spec/unit/serializers/json_serializer_spec.rb
|
247
279
|
- spec/unit/serializers/xml_serializer_spec.rb
|
248
|
-
- spec/unit/
|
249
|
-
- spec/
|
250
|
-
- spec/
|
251
|
-
- spec/support/models.rb
|
252
|
-
- LICENSE
|
253
|
-
- UPGRADES
|
254
|
-
- README.rdoc
|
280
|
+
- spec/unit/time_zones_spec.rb
|
281
|
+
- spec/unit/translation_spec.rb
|
282
|
+
- spec/unit/validations_spec.rb
|
255
283
|
homepage: http://mongomapper.com
|
256
284
|
licenses:
|
257
285
|
- MIT
|
258
286
|
metadata: {}
|
259
|
-
post_install_message:
|
287
|
+
post_install_message:
|
260
288
|
rdoc_options: []
|
261
289
|
require_paths:
|
262
290
|
- lib
|
263
291
|
required_ruby_version: !ruby/object:Gem::Requirement
|
264
292
|
requirements:
|
265
|
-
- -
|
293
|
+
- - ">="
|
266
294
|
- !ruby/object:Gem::Version
|
267
295
|
version: '0'
|
268
296
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
269
297
|
requirements:
|
270
|
-
- -
|
298
|
+
- - ">="
|
271
299
|
- !ruby/object:Gem::Version
|
272
|
-
version:
|
300
|
+
version: '0'
|
273
301
|
requirements: []
|
274
|
-
|
275
|
-
|
276
|
-
signing_key:
|
302
|
+
rubygems_version: 3.1.4
|
303
|
+
signing_key:
|
277
304
|
specification_version: 4
|
278
305
|
summary: A Ruby Object Mapper for Mongo
|
279
306
|
test_files: []
|