mongo_mapper 0.14.0 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +1 -1
- data/{README.rdoc → README.md} +26 -21
- data/examples/keys.rb +1 -1
- data/examples/modifiers/set.rb +1 -1
- data/examples/querying.rb +1 -1
- data/examples/safe.rb +2 -2
- data/examples/scopes.rb +1 -1
- data/lib/mongo_mapper/connection.rb +16 -38
- data/lib/mongo_mapper/extensions/object_id.rb +5 -1
- data/lib/mongo_mapper/plugins/accessible.rb +1 -1
- data/lib/mongo_mapper/plugins/associations/base.rb +10 -2
- data/lib/mongo_mapper/plugins/associations/belongs_to_association.rb +1 -1
- data/lib/mongo_mapper/plugins/associations/in_array_proxy.rb +36 -6
- data/lib/mongo_mapper/plugins/associations/in_foreign_array_proxy.rb +136 -0
- data/lib/mongo_mapper/plugins/associations/many_association.rb +4 -2
- data/lib/mongo_mapper/plugins/associations/proxy.rb +5 -1
- data/lib/mongo_mapper/plugins/associations/single_association.rb +5 -4
- 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/dynamic_finder.rb +1 -1
- data/lib/mongo_mapper/plugins/embedded_callbacks.rb +1 -0
- data/lib/mongo_mapper/plugins/embedded_document.rb +1 -1
- data/lib/mongo_mapper/plugins/identity_map.rb +3 -1
- data/lib/mongo_mapper/plugins/indexes.rb +13 -6
- data/lib/mongo_mapper/plugins/keys/key.rb +13 -8
- data/lib/mongo_mapper/plugins/keys.rb +9 -2
- data/lib/mongo_mapper/plugins/modifiers.rb +39 -14
- data/lib/mongo_mapper/plugins/persistence.rb +6 -2
- data/lib/mongo_mapper/plugins/querying/decorated_plucky_query.rb +6 -6
- data/lib/mongo_mapper/plugins/querying.rb +9 -3
- data/lib/mongo_mapper/plugins/safe.rb +10 -4
- data/lib/mongo_mapper/plugins/stats.rb +1 -3
- data/lib/mongo_mapper/plugins/strong_parameters.rb +26 -0
- data/lib/mongo_mapper/railtie.rb +1 -0
- data/lib/mongo_mapper/utils.rb +2 -2
- data/lib/mongo_mapper/version.rb +1 -1
- data/lib/mongo_mapper.rb +3 -0
- data/spec/examples.txt +1717 -0
- data/spec/functional/accessible_spec.rb +7 -1
- data/spec/functional/associations/belongs_to_polymorphic_proxy_spec.rb +2 -2
- data/spec/functional/associations/belongs_to_proxy_spec.rb +22 -5
- data/spec/functional/associations/in_array_proxy_spec.rb +149 -14
- data/spec/functional/associations/in_foreign_array_proxy_spec.rb +321 -0
- data/spec/functional/associations/many_documents_as_proxy_spec.rb +6 -6
- data/spec/functional/associations/many_documents_proxy_spec.rb +22 -22
- data/spec/functional/associations/many_embedded_polymorphic_proxy_spec.rb +2 -2
- data/spec/functional/associations/many_polymorphic_proxy_spec.rb +4 -4
- data/spec/functional/associations/one_as_proxy_spec.rb +8 -8
- data/spec/functional/associations/one_proxy_spec.rb +8 -8
- data/spec/functional/associations_spec.rb +3 -3
- data/spec/functional/binary_spec.rb +2 -2
- data/spec/functional/caching_spec.rb +15 -22
- data/spec/functional/callbacks_spec.rb +2 -2
- data/spec/functional/counter_cache_spec.rb +10 -10
- data/spec/functional/dirty_spec.rb +27 -10
- data/spec/functional/document_spec.rb +5 -8
- data/spec/functional/dumpable_spec.rb +1 -1
- data/spec/functional/embedded_document_spec.rb +5 -5
- data/spec/functional/identity_map_spec.rb +8 -8
- data/spec/functional/indexes_spec.rb +19 -18
- data/spec/functional/keys_spec.rb +51 -33
- data/spec/functional/logger_spec.rb +2 -2
- data/spec/functional/modifiers_spec.rb +81 -19
- data/spec/functional/partial_updates_spec.rb +8 -8
- data/spec/functional/protected_spec.rb +1 -1
- data/spec/functional/querying_spec.rb +70 -22
- data/spec/functional/safe_spec.rb +23 -27
- data/spec/functional/sci_spec.rb +7 -7
- data/spec/functional/scopes_spec.rb +1 -1
- data/spec/functional/static_keys_spec.rb +2 -2
- data/spec/functional/stats_spec.rb +28 -12
- data/spec/functional/strong_parameters_spec.rb +49 -0
- data/spec/functional/validations_spec.rb +8 -16
- data/spec/quality_spec.rb +1 -1
- data/spec/spec_helper.rb +32 -8
- data/spec/support/matchers.rb +1 -1
- data/spec/unit/associations/proxy_spec.rb +1 -5
- data/spec/unit/clone_spec.rb +1 -1
- data/spec/unit/document_spec.rb +3 -3
- data/spec/unit/embedded_document_spec.rb +4 -5
- data/spec/unit/extensions_spec.rb +3 -4
- data/spec/unit/identity_map_middleware_spec.rb +65 -96
- data/spec/unit/key_spec.rb +16 -17
- data/spec/unit/keys_spec.rb +17 -8
- data/spec/unit/mongo_mapper_spec.rb +41 -88
- data/spec/unit/rails_spec.rb +2 -2
- data/spec/unit/validations_spec.rb +18 -18
- metadata +41 -24
- data/lib/mongo_mapper/extensions/ordered_hash.rb +0 -23
@@ -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
|
-
expect(Mongo::MongoClient).to receive(:new).with('127.0.0.1', 27017, {})
|
44
|
-
expect(MongoMapper).to receive(:database=).with('test')
|
45
|
-
expect_any_instance_of(Mongo::DB).to 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
|
-
|
54
|
-
expect(MongoMapper).to receive(:database=).with('test')
|
55
|
-
expect_any_instance_of(Mongo::DB).to 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
|
-
|
64
|
-
|
65
|
-
expect_any_instance_of(Mongo::DB).to 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
|
-
expect(Mongo::MongoClient).to 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
|
-
expect(Mongo::MongoClient).to 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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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,44 +113,24 @@ 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
|
-
expect(Mongo::MongoReplicaSetClient).to receive(:new).with( ['127.0.0.1', 27017], ['localhost', 27017], {'read_secondary' => true} )
|
155
|
-
expect(MongoMapper).to receive(:database=).with('test')
|
156
|
-
expect_any_instance_of(Mongo::DB).to 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
|
-
expect(Mongo::MongoReplicaSetClient).to receive(:new).with( ['127.0.0.1:27017', 'localhost:27017'], {'read_secondary' => true} )
|
169
|
-
expect(MongoMapper).to receive(:database=).with('test')
|
170
|
-
expect_any_instance_of(Mongo::DB).to receive(:authenticate).never
|
171
|
-
MongoMapper.connect('development', 'read_secondary' => true)
|
172
|
-
end
|
173
126
|
end
|
174
127
|
|
175
128
|
context "setup" do
|
176
129
|
it "should work as shortcut for setting config, environment and options" do
|
177
130
|
config, logger = double('config'), double('logger')
|
178
|
-
|
179
|
-
|
180
|
-
|
131
|
+
MongoMapper.should_receive(:config=).with(config)
|
132
|
+
MongoMapper.should_receive(:connect).with('development', :logger => logger)
|
133
|
+
MongoMapper.should_receive(:handle_passenger_forking).once
|
181
134
|
MongoMapper.setup(config, 'development', :logger => logger)
|
182
135
|
end
|
183
136
|
end
|
data/spec/unit/rails_spec.rb
CHANGED
@@ -163,7 +163,7 @@ describe "Rails integration" do
|
|
163
163
|
|
164
164
|
it "should array representation of id if persisted" do
|
165
165
|
@klass.new.tap do |doc|
|
166
|
-
|
166
|
+
doc.should_receive(:persisted?).and_return(true)
|
167
167
|
doc.to_param.should == doc.id.to_s
|
168
168
|
end
|
169
169
|
end
|
@@ -178,7 +178,7 @@ describe "Rails integration" do
|
|
178
178
|
|
179
179
|
it "should array representation of id if persisted" do
|
180
180
|
@klass.new.tap do |doc|
|
181
|
-
|
181
|
+
doc.should_receive(:persisted?).and_return(true)
|
182
182
|
doc.to_key.should == [doc.id]
|
183
183
|
end
|
184
184
|
end
|
@@ -157,19 +157,19 @@ describe "Validations" do
|
|
157
157
|
end # numericality of
|
158
158
|
|
159
159
|
context "validating presence of" do
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
160
|
+
it "should work with validates_presence_of macro" do
|
161
|
+
@document.key :name, String
|
162
|
+
@document.validates_presence_of :name
|
163
|
+
doc = @document.new
|
164
|
+
doc.should have_error_on(:name)
|
165
|
+
end
|
166
|
+
|
167
|
+
it "should work with :required shortcut on key definition" do
|
168
|
+
@document.key :name, String, :required => true
|
169
|
+
doc = @document.new
|
170
|
+
doc.should have_error_on(:name)
|
171
|
+
end
|
172
|
+
end
|
173
173
|
|
174
174
|
context "validating exclusion of" do
|
175
175
|
it "should throw error if enumerator not provided" do
|
@@ -436,19 +436,19 @@ describe "Validations" do
|
|
436
436
|
end # numericality of
|
437
437
|
|
438
438
|
context "validating presence of" do
|
439
|
-
|
439
|
+
it "should work with validates_presence_of macro" do
|
440
440
|
@embedded_doc.key :name, String
|
441
441
|
@embedded_doc.validates_presence_of :name
|
442
442
|
doc = @embedded_doc.new
|
443
443
|
doc.should have_error_on(:name)
|
444
|
-
|
444
|
+
end
|
445
445
|
|
446
|
-
|
446
|
+
it "should work with :required shortcut on key definition" do
|
447
447
|
@embedded_doc.key :name, String, :required => true
|
448
448
|
doc = @embedded_doc.new
|
449
449
|
doc.should have_error_on(:name)
|
450
|
-
|
451
|
-
|
450
|
+
end
|
451
|
+
end
|
452
452
|
|
453
453
|
context "validating exclusion of" do
|
454
454
|
it "should throw error if enumerator not provided" do
|
metadata
CHANGED
@@ -1,73 +1,87 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
- Chris Heald
|
9
9
|
- Scott Taylor
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-10-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: mongo
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - "
|
19
|
+
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: '2.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- - "
|
26
|
+
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
28
|
+
version: '2.0'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: plucky
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 0.8.0
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.8.0
|
29
43
|
- !ruby/object:Gem::Dependency
|
30
44
|
name: activesupport
|
31
45
|
requirement: !ruby/object:Gem::Requirement
|
32
46
|
requirements:
|
33
47
|
- - ">="
|
34
48
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
49
|
+
version: '5.0'
|
36
50
|
type: :runtime
|
37
51
|
prerelease: false
|
38
52
|
version_requirements: !ruby/object:Gem::Requirement
|
39
53
|
requirements:
|
40
54
|
- - ">="
|
41
55
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
56
|
+
version: '5.0'
|
43
57
|
- !ruby/object:Gem::Dependency
|
44
|
-
name:
|
58
|
+
name: activemodel
|
45
59
|
requirement: !ruby/object:Gem::Requirement
|
46
60
|
requirements:
|
47
|
-
- - "
|
61
|
+
- - ">="
|
48
62
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
63
|
+
version: '5.0'
|
50
64
|
type: :runtime
|
51
65
|
prerelease: false
|
52
66
|
version_requirements: !ruby/object:Gem::Requirement
|
53
67
|
requirements:
|
54
|
-
- - "
|
68
|
+
- - ">="
|
55
69
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
70
|
+
version: '5.0'
|
57
71
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
72
|
+
name: activemodel-serializers-xml
|
59
73
|
requirement: !ruby/object:Gem::Requirement
|
60
74
|
requirements:
|
61
75
|
- - "~>"
|
62
76
|
- !ruby/object:Gem::Version
|
63
|
-
version: '1.
|
77
|
+
version: '1.0'
|
64
78
|
type: :runtime
|
65
79
|
prerelease: false
|
66
80
|
version_requirements: !ruby/object:Gem::Requirement
|
67
81
|
requirements:
|
68
82
|
- - "~>"
|
69
83
|
- !ruby/object:Gem::Version
|
70
|
-
version: '1.
|
84
|
+
version: '1.0'
|
71
85
|
description: MongoMapper is a Object-Document Mapper for Ruby and Rails
|
72
86
|
email:
|
73
87
|
- nunemaker@gmail.com
|
@@ -79,7 +93,7 @@ extensions: []
|
|
79
93
|
extra_rdoc_files: []
|
80
94
|
files:
|
81
95
|
- LICENSE
|
82
|
-
- README.
|
96
|
+
- README.md
|
83
97
|
- UPGRADES
|
84
98
|
- bin/mmconsole
|
85
99
|
- examples/attr_accessible.rb
|
@@ -111,7 +125,6 @@ files:
|
|
111
125
|
- lib/mongo_mapper/extensions/nil_class.rb
|
112
126
|
- lib/mongo_mapper/extensions/object.rb
|
113
127
|
- lib/mongo_mapper/extensions/object_id.rb
|
114
|
-
- lib/mongo_mapper/extensions/ordered_hash.rb
|
115
128
|
- lib/mongo_mapper/extensions/set.rb
|
116
129
|
- lib/mongo_mapper/extensions/string.rb
|
117
130
|
- lib/mongo_mapper/extensions/symbol.rb
|
@@ -129,6 +142,7 @@ files:
|
|
129
142
|
- lib/mongo_mapper/plugins/associations/collection.rb
|
130
143
|
- lib/mongo_mapper/plugins/associations/embedded_collection.rb
|
131
144
|
- lib/mongo_mapper/plugins/associations/in_array_proxy.rb
|
145
|
+
- lib/mongo_mapper/plugins/associations/in_foreign_array_proxy.rb
|
132
146
|
- lib/mongo_mapper/plugins/associations/many_association.rb
|
133
147
|
- lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb
|
134
148
|
- lib/mongo_mapper/plugins/associations/many_documents_proxy.rb
|
@@ -175,6 +189,7 @@ files:
|
|
175
189
|
- lib/mongo_mapper/plugins/scopes.rb
|
176
190
|
- lib/mongo_mapper/plugins/serialization.rb
|
177
191
|
- lib/mongo_mapper/plugins/stats.rb
|
192
|
+
- lib/mongo_mapper/plugins/strong_parameters.rb
|
178
193
|
- lib/mongo_mapper/plugins/timestamps.rb
|
179
194
|
- lib/mongo_mapper/plugins/touch.rb
|
180
195
|
- lib/mongo_mapper/plugins/userstamps.rb
|
@@ -188,10 +203,12 @@ files:
|
|
188
203
|
- lib/rails/generators/mongo_mapper/config/templates/mongo.yml
|
189
204
|
- lib/rails/generators/mongo_mapper/model/model_generator.rb
|
190
205
|
- lib/rails/generators/mongo_mapper/model/templates/model.rb
|
206
|
+
- spec/examples.txt
|
191
207
|
- spec/functional/accessible_spec.rb
|
192
208
|
- spec/functional/associations/belongs_to_polymorphic_proxy_spec.rb
|
193
209
|
- spec/functional/associations/belongs_to_proxy_spec.rb
|
194
210
|
- spec/functional/associations/in_array_proxy_spec.rb
|
211
|
+
- spec/functional/associations/in_foreign_array_proxy_spec.rb
|
195
212
|
- spec/functional/associations/many_documents_as_proxy_spec.rb
|
196
213
|
- spec/functional/associations/many_documents_proxy_spec.rb
|
197
214
|
- spec/functional/associations/many_embedded_polymorphic_proxy_spec.rb
|
@@ -228,6 +245,7 @@ files:
|
|
228
245
|
- spec/functional/scopes_spec.rb
|
229
246
|
- spec/functional/static_keys_spec.rb
|
230
247
|
- spec/functional/stats_spec.rb
|
248
|
+
- spec/functional/strong_parameters_spec.rb
|
231
249
|
- spec/functional/timestamps_spec.rb
|
232
250
|
- spec/functional/touch_spec.rb
|
233
251
|
- spec/functional/userstamps_spec.rb
|
@@ -270,7 +288,7 @@ homepage: http://mongomapper.com
|
|
270
288
|
licenses:
|
271
289
|
- MIT
|
272
290
|
metadata: {}
|
273
|
-
post_install_message:
|
291
|
+
post_install_message:
|
274
292
|
rdoc_options: []
|
275
293
|
require_paths:
|
276
294
|
- lib
|
@@ -285,9 +303,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
303
|
- !ruby/object:Gem::Version
|
286
304
|
version: '0'
|
287
305
|
requirements: []
|
288
|
-
|
289
|
-
|
290
|
-
signing_key:
|
306
|
+
rubygems_version: 3.1.4
|
307
|
+
signing_key:
|
291
308
|
specification_version: 4
|
292
309
|
summary: A Ruby Object Mapper for Mongo
|
293
310
|
test_files: []
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# This class exists to make sure that Hash's extensions don't end up giving us unordered hashes.
|
3
|
-
# :nocov:
|
4
|
-
if RUBY_VERSION < "1.9"
|
5
|
-
module MongoMapper
|
6
|
-
module Extensions
|
7
|
-
module OrderedHash
|
8
|
-
def to_mongo(value)
|
9
|
-
value
|
10
|
-
end
|
11
|
-
|
12
|
-
def from_mongo(value)
|
13
|
-
value
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class BSON::OrderedHash
|
20
|
-
extend MongoMapper::Extensions::OrderedHash
|
21
|
-
end
|
22
|
-
end
|
23
|
-
# :nocov:
|