mongoid 4.0.0.alpha1 → 4.0.0.alpha2
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 +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +1 -1
- data/lib/config/locales/en.yml +4 -6
- data/lib/mongoid/attributes/processing.rb +1 -1
- data/lib/mongoid/contextual.rb +2 -0
- data/lib/mongoid/contextual/map_reduce.rb +3 -1
- data/lib/mongoid/contextual/none.rb +90 -0
- data/lib/mongoid/criteria.rb +25 -0
- data/lib/mongoid/extensions/array.rb +1 -1
- data/lib/mongoid/extensions/big_decimal.rb +1 -1
- data/lib/mongoid/extensions/date.rb +1 -1
- data/lib/mongoid/extensions/date_time.rb +3 -3
- data/lib/mongoid/extensions/float.rb +1 -1
- data/lib/mongoid/extensions/hash.rb +1 -1
- data/lib/mongoid/extensions/integer.rb +1 -1
- data/lib/mongoid/extensions/object.rb +3 -3
- data/lib/mongoid/extensions/object_id.rb +1 -1
- data/lib/mongoid/extensions/range.rb +1 -1
- data/lib/mongoid/extensions/regexp.rb +1 -1
- data/lib/mongoid/extensions/set.rb +1 -1
- data/lib/mongoid/extensions/string.rb +1 -1
- data/lib/mongoid/extensions/symbol.rb +1 -1
- data/lib/mongoid/extensions/time.rb +1 -1
- data/lib/mongoid/extensions/time_with_zone.rb +1 -1
- data/lib/mongoid/findable.rb +1 -0
- data/lib/mongoid/interceptable.rb +4 -2
- data/lib/mongoid/persistable.rb +4 -3
- data/lib/mongoid/relations/embedded/many.rb +1 -1
- data/lib/mongoid/relations/metadata.rb +8 -4
- data/lib/mongoid/relations/referenced/many.rb +1 -1
- data/lib/mongoid/relations/touchable.rb +1 -1
- data/lib/mongoid/scopable.rb +2 -26
- data/lib/mongoid/validatable/uniqueness.rb +13 -0
- data/lib/mongoid/version.rb +1 -1
- data/lib/rails/generators/mongoid/config/templates/mongoid.yml +0 -4
- data/spec/app/models/acolyte.rb +1 -1
- data/spec/app/models/address.rb +2 -2
- data/spec/app/models/appointment.rb +1 -1
- data/spec/app/models/audio.rb +1 -1
- data/spec/app/models/dog.rb +1 -1
- data/spec/app/models/event.rb +1 -1
- data/spec/app/models/house.rb +1 -1
- data/spec/app/models/message.rb +8 -0
- data/spec/app/models/person.rb +3 -2
- data/spec/app/models/player.rb +2 -2
- data/spec/app/models/post.rb +3 -2
- data/spec/app/models/preference.rb +1 -1
- data/spec/app/models/sound.rb +1 -1
- data/spec/app/models/symptom.rb +1 -1
- data/spec/app/models/tree.rb +2 -2
- data/spec/app/models/video.rb +1 -1
- data/spec/mongoid/attributes_spec.rb +3 -3
- data/spec/mongoid/changeable_spec.rb +3 -3
- data/spec/mongoid/contextual/mongo_spec.rb +14 -14
- data/spec/mongoid/contextual/none_spec.rb +127 -0
- data/spec/mongoid/criteria/scopable_spec.rb +6 -6
- data/spec/mongoid/criteria_spec.rb +52 -96
- data/spec/mongoid/errors/invalid_scope_spec.rb +2 -2
- data/spec/mongoid/errors/mongoid_error_spec.rb +1 -1
- data/spec/mongoid/extensions/date_time_spec.rb +1 -1
- data/spec/mongoid/fields_spec.rb +6 -7
- data/spec/mongoid/findable_spec.rb +65 -0
- data/spec/mongoid/interceptable_spec.rb +11 -11
- data/spec/mongoid/persistable_spec.rb +4 -4
- data/spec/mongoid/relations/auto_save_spec.rb +1 -1
- data/spec/mongoid/relations/bindings/embedded/in_spec.rb +5 -5
- data/spec/mongoid/relations/bindings/embedded/many_spec.rb +1 -1
- data/spec/mongoid/relations/bindings/embedded/one_spec.rb +2 -2
- data/spec/mongoid/relations/bindings/referenced/in_spec.rb +14 -14
- data/spec/mongoid/relations/bindings/referenced/many_spec.rb +4 -4
- data/spec/mongoid/relations/bindings/referenced/many_to_many_spec.rb +10 -10
- data/spec/mongoid/relations/bindings/referenced/one_spec.rb +6 -6
- data/spec/mongoid/relations/builders/referenced/in_spec.rb +2 -2
- data/spec/mongoid/relations/builders/referenced/one_spec.rb +1 -1
- data/spec/mongoid/relations/cascading/delete_spec.rb +2 -2
- data/spec/mongoid/relations/cascading/destroy_spec.rb +4 -4
- data/spec/mongoid/relations/cascading/nullify_spec.rb +2 -2
- data/spec/mongoid/relations/cascading/restrict_spec.rb +4 -4
- data/spec/mongoid/relations/eager_spec.rb +6 -6
- data/spec/mongoid/relations/embedded/many_spec.rb +36 -5
- data/spec/mongoid/relations/metadata_spec.rb +34 -15
- data/spec/mongoid/relations/referenced/many_spec.rb +19 -4
- data/spec/mongoid/relations/referenced/many_to_many_spec.rb +7 -7
- data/spec/mongoid/relations/referenced/one_spec.rb +1 -1
- data/spec/mongoid/relations/targets/enumerable_spec.rb +2 -2
- data/spec/mongoid/relations/touchable_spec.rb +17 -0
- data/spec/mongoid/scopable_spec.rb +17 -40
- data/spec/mongoid/sessions/options_spec.rb +1 -1
- data/spec/mongoid/timestamps/timeless_spec.rb +6 -6
- data/spec/mongoid/timestamps/updated/short_spec.rb +1 -1
- data/spec/mongoid/timestamps/updated_spec.rb +1 -1
- data/spec/mongoid/timestamps_spec.rb +2 -2
- data/spec/mongoid/validatable/associated_spec.rb +4 -4
- data/spec/mongoid/validatable/length_spec.rb +7 -7
- data/spec/mongoid/validatable/presence_spec.rb +6 -6
- data/spec/mongoid/validatable/uniqueness_spec.rb +44 -3
- data/spec/rails/mongoid_spec.rb +20 -20
- data/spec/spec_helper.rb +1 -0
- metadata +55 -50
|
@@ -136,7 +136,7 @@ describe Mongoid::Validatable::PresenceValidator do
|
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
it "adds no errors" do
|
|
139
|
-
product.errors[:sku].
|
|
139
|
+
expect(product.errors[:sku]).to be_empty
|
|
140
140
|
end
|
|
141
141
|
end
|
|
142
142
|
|
|
@@ -147,7 +147,7 @@ describe Mongoid::Validatable::PresenceValidator do
|
|
|
147
147
|
end
|
|
148
148
|
|
|
149
149
|
it "adds errors" do
|
|
150
|
-
product.errors[:sku].
|
|
150
|
+
expect(product.errors[:sku]).to eq(["can't be blank"])
|
|
151
151
|
end
|
|
152
152
|
end
|
|
153
153
|
end
|
|
@@ -161,7 +161,7 @@ describe Mongoid::Validatable::PresenceValidator do
|
|
|
161
161
|
end
|
|
162
162
|
|
|
163
163
|
it "adds no errors" do
|
|
164
|
-
product.errors[:stock_keeping_unit].
|
|
164
|
+
expect(product.errors[:stock_keeping_unit]).to be_empty
|
|
165
165
|
end
|
|
166
166
|
end
|
|
167
167
|
|
|
@@ -172,7 +172,7 @@ describe Mongoid::Validatable::PresenceValidator do
|
|
|
172
172
|
end
|
|
173
173
|
|
|
174
174
|
it "adds errors" do
|
|
175
|
-
product.errors[:stock_keeping_unit].
|
|
175
|
+
expect(product.errors[:stock_keeping_unit]).to eq(["can't be blank"])
|
|
176
176
|
end
|
|
177
177
|
end
|
|
178
178
|
end
|
|
@@ -186,7 +186,7 @@ describe Mongoid::Validatable::PresenceValidator do
|
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
it "adds no errors" do
|
|
189
|
-
product.errors[:tagline].
|
|
189
|
+
expect(product.errors[:tagline]).to be_empty
|
|
190
190
|
end
|
|
191
191
|
end
|
|
192
192
|
|
|
@@ -200,7 +200,7 @@ describe Mongoid::Validatable::PresenceValidator do
|
|
|
200
200
|
end
|
|
201
201
|
|
|
202
202
|
it "adds errors" do
|
|
203
|
-
product.errors[:tagline].
|
|
203
|
+
expect(product.errors[:tagline]).to eq(["can't be blank in fr"])
|
|
204
204
|
end
|
|
205
205
|
end
|
|
206
206
|
end
|
|
@@ -458,7 +458,7 @@ describe Mongoid::Validatable::UniquenessValidator do
|
|
|
458
458
|
end
|
|
459
459
|
|
|
460
460
|
it "does not touch the database" do
|
|
461
|
-
Dictionary.
|
|
461
|
+
expect(Dictionary).to receive(:where).never
|
|
462
462
|
from_db.valid?
|
|
463
463
|
end
|
|
464
464
|
end
|
|
@@ -470,11 +470,11 @@ describe Mongoid::Validatable::UniquenessValidator do
|
|
|
470
470
|
|
|
471
471
|
before do
|
|
472
472
|
Dictionary.validates_uniqueness_of :name
|
|
473
|
-
Dictionary.default_scope(Dictionary.where(year: 1990))
|
|
473
|
+
Dictionary.default_scope(->{ Dictionary.where(year: 1990) })
|
|
474
474
|
end
|
|
475
475
|
|
|
476
476
|
after do
|
|
477
|
-
Dictionary.
|
|
477
|
+
Dictionary.default_scoping = nil
|
|
478
478
|
Dictionary.reset_callbacks(:validate)
|
|
479
479
|
end
|
|
480
480
|
|
|
@@ -1483,7 +1483,48 @@ describe Mongoid::Validatable::UniquenessValidator do
|
|
|
1483
1483
|
end
|
|
1484
1484
|
|
|
1485
1485
|
end
|
|
1486
|
+
end
|
|
1487
|
+
|
|
1488
|
+
context "when conditions is set" do
|
|
1489
|
+
|
|
1490
|
+
before do
|
|
1491
|
+
Band.validates_uniqueness_of :name, conditions: ->{ Band.where(active: true) }
|
|
1492
|
+
end
|
|
1493
|
+
|
|
1494
|
+
after do
|
|
1495
|
+
Band.reset_callbacks(:validate)
|
|
1496
|
+
end
|
|
1497
|
+
|
|
1498
|
+
context "when the attribute is unique" do
|
|
1499
|
+
|
|
1500
|
+
before do
|
|
1501
|
+
Band.create(name: 'Foo', active: false)
|
|
1502
|
+
end
|
|
1503
|
+
|
|
1504
|
+
let(:unique_band) do
|
|
1505
|
+
Band.new(name: 'Foo')
|
|
1506
|
+
end
|
|
1486
1507
|
|
|
1508
|
+
it "returns true" do
|
|
1509
|
+
expect(unique_band).to be_valid
|
|
1510
|
+
end
|
|
1511
|
+
|
|
1512
|
+
end
|
|
1513
|
+
|
|
1514
|
+
context "when the attribute is not unique" do
|
|
1515
|
+
|
|
1516
|
+
before do
|
|
1517
|
+
Band.create(name: 'Foo')
|
|
1518
|
+
end
|
|
1519
|
+
|
|
1520
|
+
let(:non_unique_band) do
|
|
1521
|
+
Band.new(name: 'Foo')
|
|
1522
|
+
end
|
|
1523
|
+
|
|
1524
|
+
it "returns false" do
|
|
1525
|
+
expect(non_unique_band).to_not be_valid
|
|
1526
|
+
end
|
|
1527
|
+
end
|
|
1487
1528
|
end
|
|
1488
1529
|
end
|
|
1489
1530
|
end
|
data/spec/rails/mongoid_spec.rb
CHANGED
|
@@ -30,7 +30,7 @@ describe "Rails::Mongoid" do
|
|
|
30
30
|
context "with ordinary Rails models" do
|
|
31
31
|
|
|
32
32
|
it "creates the indexes for the models" do
|
|
33
|
-
klass.
|
|
33
|
+
expect(klass).to receive(:create_indexes).once
|
|
34
34
|
indexes
|
|
35
35
|
end
|
|
36
36
|
end
|
|
@@ -42,7 +42,7 @@ describe "Rails::Mongoid" do
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
it "does nothing" do
|
|
45
|
-
klass.
|
|
45
|
+
expect(klass).to receive(:create_indexes).never
|
|
46
46
|
indexes
|
|
47
47
|
end
|
|
48
48
|
end
|
|
@@ -50,7 +50,7 @@ describe "Rails::Mongoid" do
|
|
|
50
50
|
context "when an exception is raised" do
|
|
51
51
|
|
|
52
52
|
it "is not swallowed" do
|
|
53
|
-
klass.
|
|
53
|
+
expect(klass).to receive(:create_indexes).and_raise(ArgumentError)
|
|
54
54
|
expect { indexes }.to raise_error(ArgumentError)
|
|
55
55
|
end
|
|
56
56
|
end
|
|
@@ -66,7 +66,7 @@ describe "Rails::Mongoid" do
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
it "does nothing, but logging" do
|
|
69
|
-
klass.
|
|
69
|
+
expect(klass).to receive(:create_indexes).never
|
|
70
70
|
indexes
|
|
71
71
|
end
|
|
72
72
|
end
|
|
@@ -228,7 +228,7 @@ describe "Rails::Mongoid" do
|
|
|
228
228
|
end
|
|
229
229
|
|
|
230
230
|
before do
|
|
231
|
-
logger.
|
|
231
|
+
expect(logger).to receive(:info)
|
|
232
232
|
end
|
|
233
233
|
|
|
234
234
|
it "returns nil" do
|
|
@@ -256,7 +256,7 @@ describe "Rails::Mongoid" do
|
|
|
256
256
|
end
|
|
257
257
|
|
|
258
258
|
it "logs the class without an error" do
|
|
259
|
-
logger.
|
|
259
|
+
expect(logger).to receive(:info)
|
|
260
260
|
expect {
|
|
261
261
|
expect(model).to be_nil
|
|
262
262
|
}.not_to raise_error
|
|
@@ -273,7 +273,7 @@ describe "Rails::Mongoid" do
|
|
|
273
273
|
end
|
|
274
274
|
|
|
275
275
|
it "returns klass" do
|
|
276
|
-
logger.
|
|
276
|
+
expect(logger).to receive(:info)
|
|
277
277
|
expect(model).to eq(klass)
|
|
278
278
|
end
|
|
279
279
|
end
|
|
@@ -353,8 +353,8 @@ describe "Rails::Mongoid" do
|
|
|
353
353
|
end
|
|
354
354
|
|
|
355
355
|
it "does not load any models" do
|
|
356
|
-
Dir.
|
|
357
|
-
Rails::Mongoid.
|
|
356
|
+
allow(Dir).to receive(:glob).with("/rails/root/app/models/**/*.rb").and_return(files)
|
|
357
|
+
expect(Rails::Mongoid).to receive(:load_model).never
|
|
358
358
|
Rails::Mongoid.preload_models(app)
|
|
359
359
|
end
|
|
360
360
|
end
|
|
@@ -375,12 +375,12 @@ describe "Rails::Mongoid" do
|
|
|
375
375
|
end
|
|
376
376
|
|
|
377
377
|
before do
|
|
378
|
-
Dir.
|
|
378
|
+
expect(Dir).to receive(:glob).with("/rails/root/app/models/**/*.rb").and_return(files)
|
|
379
379
|
end
|
|
380
380
|
|
|
381
381
|
it "requires the models by basename" do
|
|
382
|
-
Rails::Mongoid.
|
|
383
|
-
Rails::Mongoid.
|
|
382
|
+
expect(Rails::Mongoid).to receive(:load_model).with("address")
|
|
383
|
+
expect(Rails::Mongoid).to receive(:load_model).with("user")
|
|
384
384
|
Rails::Mongoid.preload_models(app)
|
|
385
385
|
end
|
|
386
386
|
end
|
|
@@ -392,11 +392,11 @@ describe "Rails::Mongoid" do
|
|
|
392
392
|
end
|
|
393
393
|
|
|
394
394
|
before do
|
|
395
|
-
Dir.
|
|
395
|
+
expect(Dir).to receive(:glob).with("/rails/root/app/models/**/*.rb").and_return(files)
|
|
396
396
|
end
|
|
397
397
|
|
|
398
398
|
it "requires the models by subdirectory and basename" do
|
|
399
|
-
Rails::Mongoid.
|
|
399
|
+
expect(Rails::Mongoid).to receive(:load_model).with("mongoid/behaviour")
|
|
400
400
|
Rails::Mongoid.preload_models(app)
|
|
401
401
|
end
|
|
402
402
|
end
|
|
@@ -431,9 +431,9 @@ describe "Rails::Mongoid" do
|
|
|
431
431
|
end
|
|
432
432
|
|
|
433
433
|
it "loads all models" do
|
|
434
|
-
Dir.
|
|
435
|
-
Rails::Mongoid.
|
|
436
|
-
Rails::Mongoid.
|
|
434
|
+
allow(Dir).to receive(:glob).with("/rails/root/app/models/**/*.rb").and_return(files)
|
|
435
|
+
expect(Rails::Mongoid).to receive(:load_model).with("address")
|
|
436
|
+
expect(Rails::Mongoid).to receive(:load_model).with("user")
|
|
437
437
|
Rails::Mongoid.load_models(app)
|
|
438
438
|
end
|
|
439
439
|
end
|
|
@@ -452,9 +452,9 @@ describe "Rails::Mongoid" do
|
|
|
452
452
|
end
|
|
453
453
|
|
|
454
454
|
it "loads selected models only" do
|
|
455
|
-
Dir.
|
|
456
|
-
Rails::Mongoid.
|
|
457
|
-
Rails::Mongoid.
|
|
455
|
+
allow(Dir).to receive(:glob).with("/rails/root/app/models/**/*.rb").and_return(files)
|
|
456
|
+
expect(Rails::Mongoid).to receive(:load_model).with("user")
|
|
457
|
+
expect(Rails::Mongoid).to receive(:load_model).with("address").never
|
|
458
458
|
Rails::Mongoid.load_models(app)
|
|
459
459
|
end
|
|
460
460
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mongoid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.0.
|
|
4
|
+
version: 4.0.0.alpha2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Durran Jordan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-01-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: 4.0.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: 4.0.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: tzinfo
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: 0.3.37
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: 0.3.37
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: moped
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - ~>
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 2.0.
|
|
47
|
+
version: 2.0.beta5
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - ~>
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 2.0.
|
|
54
|
+
version: 2.0.beta5
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: origin
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- - ~>
|
|
59
|
+
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '1
|
|
61
|
+
version: '2.1'
|
|
62
62
|
type: :runtime
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- - ~>
|
|
66
|
+
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '1
|
|
68
|
+
version: '2.1'
|
|
69
69
|
description: Mongoid is an ODM (Object Document Mapper) Framework for MongoDB, written
|
|
70
70
|
in Ruby.
|
|
71
71
|
email:
|
|
@@ -74,27 +74,33 @@ executables: []
|
|
|
74
74
|
extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
|
76
76
|
files:
|
|
77
|
+
- CHANGELOG.md
|
|
78
|
+
- LICENSE
|
|
79
|
+
- README.md
|
|
80
|
+
- Rakefile
|
|
77
81
|
- lib/config/locales/en.yml
|
|
82
|
+
- lib/mongoid.rb
|
|
83
|
+
- lib/mongoid/atomic.rb
|
|
78
84
|
- lib/mongoid/atomic/modifiers.rb
|
|
85
|
+
- lib/mongoid/atomic/paths.rb
|
|
86
|
+
- lib/mongoid/atomic/paths/embedded.rb
|
|
79
87
|
- lib/mongoid/atomic/paths/embedded/many.rb
|
|
80
88
|
- lib/mongoid/atomic/paths/embedded/one.rb
|
|
81
|
-
- lib/mongoid/atomic/paths/embedded.rb
|
|
82
89
|
- lib/mongoid/atomic/paths/root.rb
|
|
83
|
-
- lib/mongoid/
|
|
84
|
-
- lib/mongoid/atomic.rb
|
|
90
|
+
- lib/mongoid/attributes.rb
|
|
85
91
|
- lib/mongoid/attributes/dynamic.rb
|
|
86
92
|
- lib/mongoid/attributes/nested.rb
|
|
87
93
|
- lib/mongoid/attributes/processing.rb
|
|
88
94
|
- lib/mongoid/attributes/readonly.rb
|
|
89
|
-
- lib/mongoid/attributes.rb
|
|
90
95
|
- lib/mongoid/changeable.rb
|
|
91
96
|
- lib/mongoid/composable.rb
|
|
97
|
+
- lib/mongoid/config.rb
|
|
92
98
|
- lib/mongoid/config/environment.rb
|
|
93
99
|
- lib/mongoid/config/options.rb
|
|
100
|
+
- lib/mongoid/config/validators.rb
|
|
94
101
|
- lib/mongoid/config/validators/option.rb
|
|
95
102
|
- lib/mongoid/config/validators/session.rb
|
|
96
|
-
- lib/mongoid/
|
|
97
|
-
- lib/mongoid/config.rb
|
|
103
|
+
- lib/mongoid/contextual.rb
|
|
98
104
|
- lib/mongoid/contextual/aggregable/memory.rb
|
|
99
105
|
- lib/mongoid/contextual/aggregable/mongo.rb
|
|
100
106
|
- lib/mongoid/contextual/atomic.rb
|
|
@@ -104,18 +110,19 @@ files:
|
|
|
104
110
|
- lib/mongoid/contextual/map_reduce.rb
|
|
105
111
|
- lib/mongoid/contextual/memory.rb
|
|
106
112
|
- lib/mongoid/contextual/mongo.rb
|
|
113
|
+
- lib/mongoid/contextual/none.rb
|
|
107
114
|
- lib/mongoid/contextual/queryable.rb
|
|
108
115
|
- lib/mongoid/contextual/text_search.rb
|
|
109
|
-
- lib/mongoid/contextual.rb
|
|
110
116
|
- lib/mongoid/copyable.rb
|
|
117
|
+
- lib/mongoid/criteria.rb
|
|
111
118
|
- lib/mongoid/criteria/findable.rb
|
|
112
119
|
- lib/mongoid/criteria/inspectable.rb
|
|
113
120
|
- lib/mongoid/criteria/marshalable.rb
|
|
114
121
|
- lib/mongoid/criteria/modifiable.rb
|
|
115
122
|
- lib/mongoid/criteria/scopable.rb
|
|
116
|
-
- lib/mongoid/criteria.rb
|
|
117
123
|
- lib/mongoid/document.rb
|
|
118
124
|
- lib/mongoid/equality.rb
|
|
125
|
+
- lib/mongoid/errors.rb
|
|
119
126
|
- lib/mongoid/errors/ambiguous_relationship.rb
|
|
120
127
|
- lib/mongoid/errors/callback.rb
|
|
121
128
|
- lib/mongoid/errors/delete_restriction.rb
|
|
@@ -156,8 +163,8 @@ files:
|
|
|
156
163
|
- lib/mongoid/errors/unsaved_document.rb
|
|
157
164
|
- lib/mongoid/errors/unsupported_javascript.rb
|
|
158
165
|
- lib/mongoid/errors/validations.rb
|
|
159
|
-
- lib/mongoid/errors.rb
|
|
160
166
|
- lib/mongoid/evolvable.rb
|
|
167
|
+
- lib/mongoid/extensions.rb
|
|
161
168
|
- lib/mongoid/extensions/array.rb
|
|
162
169
|
- lib/mongoid/extensions/big_decimal.rb
|
|
163
170
|
- lib/mongoid/extensions/boolean.rb
|
|
@@ -179,22 +186,22 @@ files:
|
|
|
179
186
|
- lib/mongoid/extensions/time.rb
|
|
180
187
|
- lib/mongoid/extensions/time_with_zone.rb
|
|
181
188
|
- lib/mongoid/extensions/true_class.rb
|
|
182
|
-
- lib/mongoid/extensions.rb
|
|
183
189
|
- lib/mongoid/factory.rb
|
|
190
|
+
- lib/mongoid/fields.rb
|
|
184
191
|
- lib/mongoid/fields/foreign_key.rb
|
|
185
192
|
- lib/mongoid/fields/localized.rb
|
|
186
193
|
- lib/mongoid/fields/standard.rb
|
|
187
|
-
- lib/mongoid/fields/validators/macro.rb
|
|
188
194
|
- lib/mongoid/fields/validators.rb
|
|
189
|
-
- lib/mongoid/fields.rb
|
|
195
|
+
- lib/mongoid/fields/validators/macro.rb
|
|
190
196
|
- lib/mongoid/findable.rb
|
|
197
|
+
- lib/mongoid/indexable.rb
|
|
191
198
|
- lib/mongoid/indexable/specification.rb
|
|
192
199
|
- lib/mongoid/indexable/validators/options.rb
|
|
193
|
-
- lib/mongoid/indexable.rb
|
|
194
200
|
- lib/mongoid/inspectable.rb
|
|
195
201
|
- lib/mongoid/interceptable.rb
|
|
196
202
|
- lib/mongoid/log_subscriber.rb
|
|
197
203
|
- lib/mongoid/loggable.rb
|
|
204
|
+
- lib/mongoid/matchable.rb
|
|
198
205
|
- lib/mongoid/matchable/all.rb
|
|
199
206
|
- lib/mongoid/matchable/and.rb
|
|
200
207
|
- lib/mongoid/matchable/default.rb
|
|
@@ -208,7 +215,7 @@ files:
|
|
|
208
215
|
- lib/mongoid/matchable/nin.rb
|
|
209
216
|
- lib/mongoid/matchable/or.rb
|
|
210
217
|
- lib/mongoid/matchable/size.rb
|
|
211
|
-
- lib/mongoid/
|
|
218
|
+
- lib/mongoid/persistable.rb
|
|
212
219
|
- lib/mongoid/persistable/creatable.rb
|
|
213
220
|
- lib/mongoid/persistable/deletable.rb
|
|
214
221
|
- lib/mongoid/persistable/destroyable.rb
|
|
@@ -223,14 +230,15 @@ files:
|
|
|
223
230
|
- lib/mongoid/persistable/unsettable.rb
|
|
224
231
|
- lib/mongoid/persistable/updatable.rb
|
|
225
232
|
- lib/mongoid/persistable/upsertable.rb
|
|
226
|
-
- lib/mongoid/persistable.rb
|
|
227
233
|
- lib/mongoid/positional.rb
|
|
228
234
|
- lib/mongoid/railtie.rb
|
|
229
235
|
- lib/mongoid/railties/database.rake
|
|
230
236
|
- lib/mongoid/railties/document.rb
|
|
237
|
+
- lib/mongoid/relations.rb
|
|
231
238
|
- lib/mongoid/relations/accessors.rb
|
|
232
239
|
- lib/mongoid/relations/auto_save.rb
|
|
233
240
|
- lib/mongoid/relations/binding.rb
|
|
241
|
+
- lib/mongoid/relations/bindings.rb
|
|
234
242
|
- lib/mongoid/relations/bindings/embedded/in.rb
|
|
235
243
|
- lib/mongoid/relations/bindings/embedded/many.rb
|
|
236
244
|
- lib/mongoid/relations/bindings/embedded/one.rb
|
|
@@ -238,8 +246,8 @@ files:
|
|
|
238
246
|
- lib/mongoid/relations/bindings/referenced/many.rb
|
|
239
247
|
- lib/mongoid/relations/bindings/referenced/many_to_many.rb
|
|
240
248
|
- lib/mongoid/relations/bindings/referenced/one.rb
|
|
241
|
-
- lib/mongoid/relations/bindings.rb
|
|
242
249
|
- lib/mongoid/relations/builder.rb
|
|
250
|
+
- lib/mongoid/relations/builders.rb
|
|
243
251
|
- lib/mongoid/relations/builders/embedded/in.rb
|
|
244
252
|
- lib/mongoid/relations/builders/embedded/many.rb
|
|
245
253
|
- lib/mongoid/relations/builders/embedded/one.rb
|
|
@@ -249,22 +257,21 @@ files:
|
|
|
249
257
|
- lib/mongoid/relations/builders/referenced/many.rb
|
|
250
258
|
- lib/mongoid/relations/builders/referenced/many_to_many.rb
|
|
251
259
|
- lib/mongoid/relations/builders/referenced/one.rb
|
|
252
|
-
- lib/mongoid/relations/
|
|
260
|
+
- lib/mongoid/relations/cascading.rb
|
|
253
261
|
- lib/mongoid/relations/cascading/delete.rb
|
|
254
262
|
- lib/mongoid/relations/cascading/destroy.rb
|
|
255
263
|
- lib/mongoid/relations/cascading/nullify.rb
|
|
256
264
|
- lib/mongoid/relations/cascading/restrict.rb
|
|
257
|
-
- lib/mongoid/relations/cascading.rb
|
|
258
265
|
- lib/mongoid/relations/constraint.rb
|
|
259
266
|
- lib/mongoid/relations/conversions.rb
|
|
260
267
|
- lib/mongoid/relations/counter_cache.rb
|
|
261
268
|
- lib/mongoid/relations/cyclic.rb
|
|
269
|
+
- lib/mongoid/relations/eager.rb
|
|
262
270
|
- lib/mongoid/relations/eager/base.rb
|
|
263
271
|
- lib/mongoid/relations/eager/belongs_to.rb
|
|
264
272
|
- lib/mongoid/relations/eager/has_and_belongs_to_many.rb
|
|
265
273
|
- lib/mongoid/relations/eager/has_many.rb
|
|
266
274
|
- lib/mongoid/relations/eager/has_one.rb
|
|
267
|
-
- lib/mongoid/relations/eager.rb
|
|
268
275
|
- lib/mongoid/relations/embedded/batchable.rb
|
|
269
276
|
- lib/mongoid/relations/embedded/in.rb
|
|
270
277
|
- lib/mongoid/relations/embedded/many.rb
|
|
@@ -284,35 +291,35 @@ files:
|
|
|
284
291
|
- lib/mongoid/relations/referenced/one.rb
|
|
285
292
|
- lib/mongoid/relations/reflections.rb
|
|
286
293
|
- lib/mongoid/relations/synchronization.rb
|
|
287
|
-
- lib/mongoid/relations/targets/enumerable.rb
|
|
288
294
|
- lib/mongoid/relations/targets.rb
|
|
295
|
+
- lib/mongoid/relations/targets/enumerable.rb
|
|
289
296
|
- lib/mongoid/relations/touchable.rb
|
|
290
|
-
- lib/mongoid/relations.rb
|
|
291
297
|
- lib/mongoid/reloadable.rb
|
|
292
298
|
- lib/mongoid/scopable.rb
|
|
293
299
|
- lib/mongoid/selectable.rb
|
|
294
300
|
- lib/mongoid/serializable.rb
|
|
301
|
+
- lib/mongoid/sessions.rb
|
|
295
302
|
- lib/mongoid/sessions/factory.rb
|
|
296
303
|
- lib/mongoid/sessions/mongo_uri.rb
|
|
297
304
|
- lib/mongoid/sessions/options.rb
|
|
298
305
|
- lib/mongoid/sessions/storage_options.rb
|
|
299
306
|
- lib/mongoid/sessions/thread_options.rb
|
|
300
|
-
- lib/mongoid/sessions/validators/storage.rb
|
|
301
307
|
- lib/mongoid/sessions/validators.rb
|
|
302
|
-
- lib/mongoid/sessions.rb
|
|
308
|
+
- lib/mongoid/sessions/validators/storage.rb
|
|
303
309
|
- lib/mongoid/shardable.rb
|
|
304
310
|
- lib/mongoid/state.rb
|
|
305
311
|
- lib/mongoid/support/query_counter.rb
|
|
306
|
-
- lib/mongoid/threaded/lifecycle.rb
|
|
307
312
|
- lib/mongoid/threaded.rb
|
|
308
|
-
- lib/mongoid/
|
|
313
|
+
- lib/mongoid/threaded/lifecycle.rb
|
|
314
|
+
- lib/mongoid/timestamps.rb
|
|
309
315
|
- lib/mongoid/timestamps/created.rb
|
|
316
|
+
- lib/mongoid/timestamps/created/short.rb
|
|
310
317
|
- lib/mongoid/timestamps/short.rb
|
|
311
318
|
- lib/mongoid/timestamps/timeless.rb
|
|
312
|
-
- lib/mongoid/timestamps/updated/short.rb
|
|
313
319
|
- lib/mongoid/timestamps/updated.rb
|
|
314
|
-
- lib/mongoid/timestamps.rb
|
|
320
|
+
- lib/mongoid/timestamps/updated/short.rb
|
|
315
321
|
- lib/mongoid/traversable.rb
|
|
322
|
+
- lib/mongoid/validatable.rb
|
|
316
323
|
- lib/mongoid/validatable/associated.rb
|
|
317
324
|
- lib/mongoid/validatable/format.rb
|
|
318
325
|
- lib/mongoid/validatable/length.rb
|
|
@@ -321,9 +328,7 @@ files:
|
|
|
321
328
|
- lib/mongoid/validatable/presence.rb
|
|
322
329
|
- lib/mongoid/validatable/queryable.rb
|
|
323
330
|
- lib/mongoid/validatable/uniqueness.rb
|
|
324
|
-
- lib/mongoid/validatable.rb
|
|
325
331
|
- lib/mongoid/version.rb
|
|
326
|
-
- lib/mongoid.rb
|
|
327
332
|
- lib/rails/generators/mongoid/config/config_generator.rb
|
|
328
333
|
- lib/rails/generators/mongoid/config/templates/mongoid.yml
|
|
329
334
|
- lib/rails/generators/mongoid/model/model_generator.rb
|
|
@@ -331,10 +336,6 @@ files:
|
|
|
331
336
|
- lib/rails/generators/mongoid_generator.rb
|
|
332
337
|
- lib/rails/mongoid.rb
|
|
333
338
|
- lib/support/ruby_version.rb
|
|
334
|
-
- CHANGELOG.md
|
|
335
|
-
- LICENSE
|
|
336
|
-
- README.md
|
|
337
|
-
- Rakefile
|
|
338
339
|
- spec/app/models/account.rb
|
|
339
340
|
- spec/app/models/acolyte.rb
|
|
340
341
|
- spec/app/models/actor.rb
|
|
@@ -433,6 +434,7 @@ files:
|
|
|
433
434
|
- spec/app/models/manufacturer.rb
|
|
434
435
|
- spec/app/models/meat.rb
|
|
435
436
|
- spec/app/models/membership.rb
|
|
437
|
+
- spec/app/models/message.rb
|
|
436
438
|
- spec/app/models/mixed_drink.rb
|
|
437
439
|
- spec/app/models/movie.rb
|
|
438
440
|
- spec/app/models/my_hash.rb
|
|
@@ -546,6 +548,7 @@ files:
|
|
|
546
548
|
- spec/mongoid/contextual/map_reduce_spec.rb
|
|
547
549
|
- spec/mongoid/contextual/memory_spec.rb
|
|
548
550
|
- spec/mongoid/contextual/mongo_spec.rb
|
|
551
|
+
- spec/mongoid/contextual/none_spec.rb
|
|
549
552
|
- spec/mongoid/contextual/text_search_spec.rb
|
|
550
553
|
- spec/mongoid/copyable_spec.rb
|
|
551
554
|
- spec/mongoid/criteria/findable_spec.rb
|
|
@@ -751,17 +754,17 @@ require_paths:
|
|
|
751
754
|
- lib
|
|
752
755
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
753
756
|
requirements:
|
|
754
|
-
- -
|
|
757
|
+
- - ">="
|
|
755
758
|
- !ruby/object:Gem::Version
|
|
756
759
|
version: '1.9'
|
|
757
760
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
758
761
|
requirements:
|
|
759
|
-
- -
|
|
762
|
+
- - ">="
|
|
760
763
|
- !ruby/object:Gem::Version
|
|
761
764
|
version: 1.3.6
|
|
762
765
|
requirements: []
|
|
763
766
|
rubyforge_project: mongoid
|
|
764
|
-
rubygems_version: 2.
|
|
767
|
+
rubygems_version: 2.2.0
|
|
765
768
|
signing_key:
|
|
766
769
|
specification_version: 4
|
|
767
770
|
summary: Elegant Persistance in Ruby for MongoDB.
|
|
@@ -864,6 +867,7 @@ test_files:
|
|
|
864
867
|
- spec/app/models/manufacturer.rb
|
|
865
868
|
- spec/app/models/meat.rb
|
|
866
869
|
- spec/app/models/membership.rb
|
|
870
|
+
- spec/app/models/message.rb
|
|
867
871
|
- spec/app/models/mixed_drink.rb
|
|
868
872
|
- spec/app/models/movie.rb
|
|
869
873
|
- spec/app/models/my_hash.rb
|
|
@@ -977,6 +981,7 @@ test_files:
|
|
|
977
981
|
- spec/mongoid/contextual/map_reduce_spec.rb
|
|
978
982
|
- spec/mongoid/contextual/memory_spec.rb
|
|
979
983
|
- spec/mongoid/contextual/mongo_spec.rb
|
|
984
|
+
- spec/mongoid/contextual/none_spec.rb
|
|
980
985
|
- spec/mongoid/contextual/text_search_spec.rb
|
|
981
986
|
- spec/mongoid/copyable_spec.rb
|
|
982
987
|
- spec/mongoid/criteria/findable_spec.rb
|