mongoid 1.2.14 → 1.9.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.
- data/lib/mongoid.rb +10 -3
- data/lib/mongoid/associations.rb +133 -97
- data/lib/mongoid/associations/belongs_to_related.rb +2 -3
- data/lib/mongoid/associations/{belongs_to.rb → embedded_in.rb} +14 -6
- data/lib/mongoid/associations/{has_many.rb → embeds_many.rb} +89 -31
- data/lib/mongoid/associations/{has_one.rb → embeds_one.rb} +8 -7
- data/lib/mongoid/associations/has_many_related.rb +52 -7
- data/lib/mongoid/associations/has_one_related.rb +8 -4
- data/lib/mongoid/associations/meta_data.rb +2 -1
- data/lib/mongoid/associations/options.rb +6 -1
- data/lib/mongoid/associations/proxy.rb +14 -21
- data/lib/mongoid/attributes.rb +27 -12
- data/lib/mongoid/collection.rb +4 -3
- data/lib/mongoid/collections.rb +41 -0
- data/lib/mongoid/collections/master.rb +3 -2
- data/lib/mongoid/collections/slaves.rb +3 -2
- data/lib/mongoid/components.rb +21 -19
- data/lib/mongoid/concern.rb +31 -0
- data/lib/mongoid/config.rb +117 -12
- data/lib/mongoid/contexts.rb +1 -1
- data/lib/mongoid/contexts/enumerable.rb +1 -1
- data/lib/mongoid/contexts/mongo.rb +1 -1
- data/lib/mongoid/contexts/paging.rb +10 -2
- data/lib/mongoid/criterion/inclusion.rb +17 -0
- data/lib/mongoid/criterion/optional.rb +1 -1
- data/lib/mongoid/dirty.rb +253 -0
- data/lib/mongoid/document.rb +81 -52
- data/lib/mongoid/errors.rb +32 -1
- data/lib/mongoid/extensions.rb +11 -9
- data/lib/mongoid/extensions/big_decimal/conversions.rb +2 -2
- data/lib/mongoid/extensions/boolean/conversions.rb +8 -2
- data/lib/mongoid/extensions/date/conversions.rb +13 -4
- data/lib/mongoid/extensions/datetime/conversions.rb +1 -6
- data/lib/mongoid/extensions/float/conversions.rb +5 -1
- data/lib/mongoid/extensions/hash/assimilation.rb +12 -3
- data/lib/mongoid/extensions/hash/conversions.rb +34 -4
- data/lib/mongoid/extensions/integer/conversions.rb +5 -1
- data/lib/mongoid/extensions/nil/assimilation.rb +4 -0
- data/lib/mongoid/extensions/object/conversions.rb +1 -1
- data/lib/mongoid/extensions/string/conversions.rb +1 -1
- data/lib/mongoid/extensions/symbol/inflections.rb +1 -1
- data/lib/mongoid/extensions/time_conversions.rb +35 -0
- data/lib/mongoid/extras.rb +6 -9
- data/lib/mongoid/factory.rb +2 -1
- data/lib/mongoid/field.rb +9 -2
- data/lib/mongoid/fields.rb +1 -0
- data/lib/mongoid/identity.rb +3 -3
- data/lib/mongoid/indexes.rb +3 -3
- data/lib/mongoid/memoization.rb +8 -2
- data/lib/mongoid/named_scope.rb +0 -3
- data/lib/mongoid/observable.rb +30 -0
- data/lib/mongoid/paths.rb +62 -0
- data/lib/mongoid/persistence.rb +222 -0
- data/lib/mongoid/persistence/command.rb +39 -0
- data/lib/mongoid/persistence/insert.rb +50 -0
- data/lib/mongoid/persistence/insert_embedded.rb +38 -0
- data/lib/mongoid/persistence/remove.rb +39 -0
- data/lib/mongoid/persistence/remove_all.rb +37 -0
- data/lib/mongoid/persistence/remove_embedded.rb +50 -0
- data/lib/mongoid/persistence/update.rb +63 -0
- data/lib/mongoid/state.rb +28 -21
- data/lib/mongoid/timestamps.rb +5 -8
- data/lib/mongoid/version.rb +4 -0
- data/lib/mongoid/versioning.rb +6 -7
- metadata +81 -300
- data/.gitignore +0 -6
- data/.watchr +0 -29
- data/Rakefile +0 -53
- data/VERSION +0 -1
- data/caliper.yml +0 -4
- data/lib/mongoid/collections/mimic.rb +0 -46
- data/lib/mongoid/commands.rb +0 -174
- data/lib/mongoid/commands/create.rb +0 -21
- data/lib/mongoid/commands/delete.rb +0 -16
- data/lib/mongoid/commands/delete_all.rb +0 -23
- data/lib/mongoid/commands/deletion.rb +0 -18
- data/lib/mongoid/commands/destroy.rb +0 -19
- data/lib/mongoid/commands/destroy_all.rb +0 -23
- data/lib/mongoid/commands/save.rb +0 -27
- data/lib/mongoid/extensions/time/conversions.rb +0 -18
- data/mongoid.gemspec +0 -395
- data/perf/benchmark.rb +0 -77
- data/spec/integration/mongoid/associations_spec.rb +0 -340
- data/spec/integration/mongoid/attributes_spec.rb +0 -22
- data/spec/integration/mongoid/commands_spec.rb +0 -218
- data/spec/integration/mongoid/contexts/enumerable_spec.rb +0 -33
- data/spec/integration/mongoid/criteria_spec.rb +0 -272
- data/spec/integration/mongoid/document_spec.rb +0 -593
- data/spec/integration/mongoid/extensions_spec.rb +0 -26
- data/spec/integration/mongoid/finders_spec.rb +0 -119
- data/spec/integration/mongoid/inheritance_spec.rb +0 -137
- data/spec/integration/mongoid/named_scope_spec.rb +0 -46
- data/spec/models/address.rb +0 -39
- data/spec/models/animal.rb +0 -6
- data/spec/models/callbacks.rb +0 -18
- data/spec/models/comment.rb +0 -8
- data/spec/models/country_code.rb +0 -6
- data/spec/models/employer.rb +0 -5
- data/spec/models/game.rb +0 -7
- data/spec/models/inheritance.rb +0 -56
- data/spec/models/location.rb +0 -5
- data/spec/models/mixed_drink.rb +0 -4
- data/spec/models/name.rb +0 -13
- data/spec/models/namespacing.rb +0 -11
- data/spec/models/patient.rb +0 -4
- data/spec/models/person.rb +0 -99
- data/spec/models/pet.rb +0 -7
- data/spec/models/pet_owner.rb +0 -6
- data/spec/models/phone.rb +0 -7
- data/spec/models/post.rb +0 -15
- data/spec/models/translation.rb +0 -5
- data/spec/models/vet_visit.rb +0 -5
- data/spec/spec.opts +0 -3
- data/spec/spec_helper.rb +0 -31
- data/spec/unit/mongoid/associations/belongs_to_related_spec.rb +0 -145
- data/spec/unit/mongoid/associations/belongs_to_spec.rb +0 -193
- data/spec/unit/mongoid/associations/has_many_related_spec.rb +0 -420
- data/spec/unit/mongoid/associations/has_many_spec.rb +0 -519
- data/spec/unit/mongoid/associations/has_one_related_spec.rb +0 -179
- data/spec/unit/mongoid/associations/has_one_spec.rb +0 -282
- data/spec/unit/mongoid/associations/meta_data_spec.rb +0 -88
- data/spec/unit/mongoid/associations/options_spec.rb +0 -192
- data/spec/unit/mongoid/associations_spec.rb +0 -595
- data/spec/unit/mongoid/attributes_spec.rb +0 -507
- data/spec/unit/mongoid/callbacks_spec.rb +0 -55
- data/spec/unit/mongoid/collection_spec.rb +0 -187
- data/spec/unit/mongoid/collections/cyclic_iterator_spec.rb +0 -75
- data/spec/unit/mongoid/collections/master_spec.rb +0 -41
- data/spec/unit/mongoid/collections/mimic_spec.rb +0 -43
- data/spec/unit/mongoid/collections/slaves_spec.rb +0 -81
- data/spec/unit/mongoid/commands/create_spec.rb +0 -30
- data/spec/unit/mongoid/commands/delete_all_spec.rb +0 -58
- data/spec/unit/mongoid/commands/delete_spec.rb +0 -38
- data/spec/unit/mongoid/commands/destroy_all_spec.rb +0 -23
- data/spec/unit/mongoid/commands/destroy_spec.rb +0 -50
- data/spec/unit/mongoid/commands/save_spec.rb +0 -105
- data/spec/unit/mongoid/commands_spec.rb +0 -275
- data/spec/unit/mongoid/config_spec.rb +0 -172
- data/spec/unit/mongoid/contexts/enumerable_spec.rb +0 -421
- data/spec/unit/mongoid/contexts/mongo_spec.rb +0 -682
- data/spec/unit/mongoid/contexts_spec.rb +0 -25
- data/spec/unit/mongoid/criteria_spec.rb +0 -824
- data/spec/unit/mongoid/criterion/complex_spec.rb +0 -19
- data/spec/unit/mongoid/criterion/exclusion_spec.rb +0 -91
- data/spec/unit/mongoid/criterion/inclusion_spec.rb +0 -219
- data/spec/unit/mongoid/criterion/optional_spec.rb +0 -319
- data/spec/unit/mongoid/cursor_spec.rb +0 -74
- data/spec/unit/mongoid/deprecation_spec.rb +0 -24
- data/spec/unit/mongoid/document_spec.rb +0 -952
- data/spec/unit/mongoid/errors_spec.rb +0 -103
- data/spec/unit/mongoid/extensions/array/accessors_spec.rb +0 -50
- data/spec/unit/mongoid/extensions/array/assimilation_spec.rb +0 -24
- data/spec/unit/mongoid/extensions/array/conversions_spec.rb +0 -35
- data/spec/unit/mongoid/extensions/array/parentization_spec.rb +0 -20
- data/spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb +0 -22
- data/spec/unit/mongoid/extensions/binary/conversions_spec.rb +0 -22
- data/spec/unit/mongoid/extensions/boolean/conversions_spec.rb +0 -49
- data/spec/unit/mongoid/extensions/date/conversions_spec.rb +0 -102
- data/spec/unit/mongoid/extensions/datetime/conversions_spec.rb +0 -70
- data/spec/unit/mongoid/extensions/float/conversions_spec.rb +0 -61
- data/spec/unit/mongoid/extensions/hash/accessors_spec.rb +0 -184
- data/spec/unit/mongoid/extensions/hash/assimilation_spec.rb +0 -46
- data/spec/unit/mongoid/extensions/hash/conversions_spec.rb +0 -21
- data/spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb +0 -17
- data/spec/unit/mongoid/extensions/hash/scoping_spec.rb +0 -14
- data/spec/unit/mongoid/extensions/integer/conversions_spec.rb +0 -61
- data/spec/unit/mongoid/extensions/nil/assimilation_spec.rb +0 -24
- data/spec/unit/mongoid/extensions/object/conversions_spec.rb +0 -57
- data/spec/unit/mongoid/extensions/proc/scoping_spec.rb +0 -34
- data/spec/unit/mongoid/extensions/string/conversions_spec.rb +0 -17
- data/spec/unit/mongoid/extensions/string/inflections_spec.rb +0 -208
- data/spec/unit/mongoid/extensions/symbol/inflections_spec.rb +0 -91
- data/spec/unit/mongoid/extensions/time/conversions_spec.rb +0 -70
- data/spec/unit/mongoid/extras_spec.rb +0 -102
- data/spec/unit/mongoid/factory_spec.rb +0 -31
- data/spec/unit/mongoid/field_spec.rb +0 -143
- data/spec/unit/mongoid/fields_spec.rb +0 -181
- data/spec/unit/mongoid/finders_spec.rb +0 -404
- data/spec/unit/mongoid/identity_spec.rb +0 -109
- data/spec/unit/mongoid/indexes_spec.rb +0 -93
- data/spec/unit/mongoid/javascript_spec.rb +0 -48
- data/spec/unit/mongoid/matchers/all_spec.rb +0 -27
- data/spec/unit/mongoid/matchers/default_spec.rb +0 -27
- data/spec/unit/mongoid/matchers/exists_spec.rb +0 -56
- data/spec/unit/mongoid/matchers/gt_spec.rb +0 -39
- data/spec/unit/mongoid/matchers/gte_spec.rb +0 -49
- data/spec/unit/mongoid/matchers/in_spec.rb +0 -27
- data/spec/unit/mongoid/matchers/lt_spec.rb +0 -39
- data/spec/unit/mongoid/matchers/lte_spec.rb +0 -49
- data/spec/unit/mongoid/matchers/ne_spec.rb +0 -27
- data/spec/unit/mongoid/matchers/nin_spec.rb +0 -27
- data/spec/unit/mongoid/matchers/size_spec.rb +0 -27
- data/spec/unit/mongoid/matchers_spec.rb +0 -329
- data/spec/unit/mongoid/memoization_spec.rb +0 -75
- data/spec/unit/mongoid/named_scope_spec.rb +0 -123
- data/spec/unit/mongoid/scope_spec.rb +0 -240
- data/spec/unit/mongoid/state_spec.rb +0 -83
- data/spec/unit/mongoid/timestamps_spec.rb +0 -25
- data/spec/unit/mongoid/versioning_spec.rb +0 -41
- data/spec/unit/mongoid_spec.rb +0 -46
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module Persistence #:nodoc:
|
4
|
+
# Insert is a persistence command responsible for taking a document that
|
5
|
+
# has not been saved to the database and saving it. This specific class
|
6
|
+
# handles the case when the document is embedded in another.
|
7
|
+
#
|
8
|
+
# The underlying query resembles the following MongoDB query:
|
9
|
+
#
|
10
|
+
# collection.insert(
|
11
|
+
# { "_id" : 1, "field" : "value" },
|
12
|
+
# false
|
13
|
+
# );
|
14
|
+
class InsertEmbedded < Command
|
15
|
+
# Insert the new document in the database. If the document's parent is a
|
16
|
+
# new record, we will call save on the parent, otherwise we will $push
|
17
|
+
# the document onto the parent.
|
18
|
+
#
|
19
|
+
# Example:
|
20
|
+
#
|
21
|
+
# <tt>Insert.persist</tt>
|
22
|
+
#
|
23
|
+
# Returns:
|
24
|
+
#
|
25
|
+
# The +Document+, whether the insert succeeded or not.
|
26
|
+
def persist
|
27
|
+
parent = @document._parent
|
28
|
+
if parent.new_record?
|
29
|
+
parent.insert
|
30
|
+
else
|
31
|
+
update = { @document._inserter => { @document._position => @document.raw_attributes } }
|
32
|
+
@collection.update(parent._selector, update, @options.merge(:multi => false))
|
33
|
+
end
|
34
|
+
@document.new_record = false; @document
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module Persistence #:nodoc:
|
4
|
+
# Remove is a persistence command responsible for deleting a document from
|
5
|
+
# the database.
|
6
|
+
#
|
7
|
+
# The underlying query resembles the following MongoDB query:
|
8
|
+
#
|
9
|
+
# collection.remove(
|
10
|
+
# { "_id" : 1 },
|
11
|
+
# false
|
12
|
+
# );
|
13
|
+
class Remove < Command
|
14
|
+
# Remove the document from the database: delegates to the MongoDB
|
15
|
+
# collection remove method.
|
16
|
+
#
|
17
|
+
# Example:
|
18
|
+
#
|
19
|
+
# <tt>Remove.persist</tt>
|
20
|
+
#
|
21
|
+
# Returns:
|
22
|
+
#
|
23
|
+
# +true+ if success, +false+ if not.
|
24
|
+
def persist
|
25
|
+
remove
|
26
|
+
end
|
27
|
+
|
28
|
+
protected
|
29
|
+
# Remove the document from the database.
|
30
|
+
def remove
|
31
|
+
if @document.embedded?
|
32
|
+
Persistence::RemoveEmbedded.new(@document, @validate).persist
|
33
|
+
else
|
34
|
+
@collection.remove({ :_id => @document.id }, @options)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module Persistence #:nodoc:
|
4
|
+
# Remove is a persistence command responsible for deleting a document from
|
5
|
+
# the database.
|
6
|
+
#
|
7
|
+
# The underlying query resembles the following MongoDB query:
|
8
|
+
#
|
9
|
+
# collection.remove(
|
10
|
+
# { "field" : value },
|
11
|
+
# false
|
12
|
+
# );
|
13
|
+
class RemoveAll < Command
|
14
|
+
# Remove the document from the database: delegates to the MongoDB
|
15
|
+
# collection remove method.
|
16
|
+
#
|
17
|
+
# Example:
|
18
|
+
#
|
19
|
+
# <tt>Remove.persist</tt>
|
20
|
+
#
|
21
|
+
# Returns:
|
22
|
+
#
|
23
|
+
# +true+ if success, +false+ if not.
|
24
|
+
def persist
|
25
|
+
remove
|
26
|
+
end
|
27
|
+
|
28
|
+
protected
|
29
|
+
# Remove the document from the database.
|
30
|
+
def remove
|
31
|
+
count = @collection.find(@selector.merge(:_type => @klass.name)).count
|
32
|
+
@collection.remove(@selector, @options)
|
33
|
+
count
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module Persistence #:nodoc:
|
4
|
+
# Remove is a persistence command responsible for deleting a document from
|
5
|
+
# the database.
|
6
|
+
#
|
7
|
+
# The underlying query resembles the following MongoDB query:
|
8
|
+
#
|
9
|
+
# collection.remove(
|
10
|
+
# { "_id" : 1 },
|
11
|
+
# false
|
12
|
+
# );
|
13
|
+
class RemoveEmbedded < Command
|
14
|
+
# Insert the new document in the database. If the document's parent is a
|
15
|
+
# new record, we will call save on the parent, otherwise we will $push
|
16
|
+
# the document onto the parent.
|
17
|
+
#
|
18
|
+
# Remove the document from the database. If the parent is a new record,
|
19
|
+
# it will get removed in Ruby only. If the parent is not a new record
|
20
|
+
# then either an $unset or $set will occur, depending if it's an
|
21
|
+
# embeds_one or embeds_many.
|
22
|
+
#
|
23
|
+
# Example:
|
24
|
+
#
|
25
|
+
# <tt>RemoveEmbedded.persist</tt>
|
26
|
+
#
|
27
|
+
# Returns:
|
28
|
+
#
|
29
|
+
# +true+ or +false+, depending on if the removal passed.
|
30
|
+
def persist
|
31
|
+
parent = @document._parent
|
32
|
+
parent.remove(@document)
|
33
|
+
unless parent.new_record?
|
34
|
+
update = { @document._remover => removal_selector }
|
35
|
+
@collection.update(parent._selector, update, @options.merge(:multi => false))
|
36
|
+
end; true
|
37
|
+
end
|
38
|
+
|
39
|
+
protected
|
40
|
+
# Get the value to pass to the removal modifier.
|
41
|
+
def setter
|
42
|
+
@document._index ? @document.id : true
|
43
|
+
end
|
44
|
+
|
45
|
+
def removal_selector
|
46
|
+
@document._index ? { @document._pull => { "_id" => @document.id } } : { @document._path => setter }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module Persistence #:nodoc:
|
4
|
+
# Update is a persistence command responsible for taking a document that
|
5
|
+
# has already been saved to the database and saving it, depending on
|
6
|
+
# whether or not the document has been modified.
|
7
|
+
#
|
8
|
+
# Before persisting the command will check via dirty attributes if the
|
9
|
+
# document has changed, if not, it will simply return true. If it has it
|
10
|
+
# will go through the validation steps, run callbacks, and set the changed
|
11
|
+
# fields atomically on the document. The underlying query resembles the
|
12
|
+
# following MongoDB query:
|
13
|
+
#
|
14
|
+
# collection.update(
|
15
|
+
# { "_id" : 1,
|
16
|
+
# { "$set" : { "field" : "value" },
|
17
|
+
# false,
|
18
|
+
# false
|
19
|
+
# );
|
20
|
+
#
|
21
|
+
# For embedded documents it will use the positional locator:
|
22
|
+
#
|
23
|
+
# collection.update(
|
24
|
+
# { "_id" : 1, "addresses._id" : 2 },
|
25
|
+
# { "$set" : { "addresses.$.field" : "value" },
|
26
|
+
# false,
|
27
|
+
# false
|
28
|
+
# );
|
29
|
+
#
|
30
|
+
class Update < Command
|
31
|
+
# Persist the document that is to be updated to the database. This will
|
32
|
+
# only write changed fields via MongoDB's $set modifier operation.
|
33
|
+
#
|
34
|
+
# Example:
|
35
|
+
#
|
36
|
+
# <tt>Update.persist</tt>
|
37
|
+
#
|
38
|
+
# Returns:
|
39
|
+
#
|
40
|
+
# +true+ or +false+, depending on validation.
|
41
|
+
def persist
|
42
|
+
return false if validate && !@document.valid?
|
43
|
+
@document.run_callbacks(:before_save)
|
44
|
+
@document.run_callbacks(:before_update)
|
45
|
+
if update
|
46
|
+
@document.move_changes
|
47
|
+
@document.run_callbacks(:after_save)
|
48
|
+
@document.run_callbacks(:after_update)
|
49
|
+
else
|
50
|
+
return false
|
51
|
+
end; true
|
52
|
+
end
|
53
|
+
|
54
|
+
protected
|
55
|
+
# Update the document in the database atomically.
|
56
|
+
def update
|
57
|
+
if @document.changed?
|
58
|
+
@collection.update(@document._selector, { "$set" => @document.setters }, @options.merge(:multi => false))
|
59
|
+
end; true
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/lib/mongoid/state.rb
CHANGED
@@ -1,32 +1,39 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
module Mongoid #:nodoc:
|
3
3
|
module State #:nodoc:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
def new_record?
|
8
|
-
@new_record == true
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
included do
|
6
|
+
attr_reader :new_record
|
9
7
|
end
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
@new_record
|
14
|
-
|
9
|
+
module InstanceMethods
|
10
|
+
# Returns true if the +Document+ has not been persisted to the database,
|
11
|
+
# false if it has. This is determined by the variable @new_record
|
12
|
+
# and NOT if the object has an id.
|
13
|
+
def new_record?
|
14
|
+
!!@new_record
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
# Sets the new_record boolean - used after document is saved.
|
18
|
+
def new_record=(saved)
|
19
|
+
@new_record = saved
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
# Checks if the document has been saved to the database.
|
23
|
+
def persisted?
|
24
|
+
!new_record?
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns true if the +Document+ has been succesfully destroyed, and false if it hasn't.
|
28
|
+
# This is determined by the variable @destroyed and NOT by checking the database.
|
29
|
+
def destroyed?
|
30
|
+
@destroyed == true
|
31
|
+
end
|
26
32
|
|
27
|
-
|
28
|
-
|
29
|
-
|
33
|
+
# Sets the destroyed boolean - used after document is destroyed.
|
34
|
+
def destroyed=(destroyed)
|
35
|
+
@destroyed = destroyed && true
|
36
|
+
end
|
30
37
|
end
|
31
38
|
end
|
32
39
|
end
|
data/lib/mongoid/timestamps.rb
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
module Mongoid
|
3
3
|
module Timestamps
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
field :updated_at, :type => Time
|
10
|
-
before_save :set_created_at, :set_updated_at
|
11
|
-
end
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
included do
|
6
|
+
field :created_at, :type => Time
|
7
|
+
field :updated_at, :type => Time
|
8
|
+
before_save :set_created_at, :set_updated_at
|
12
9
|
end
|
13
10
|
|
14
11
|
module InstanceMethods
|
data/lib/mongoid/versioning.rb
CHANGED
@@ -4,13 +4,11 @@ module Mongoid #:nodoc:
|
|
4
4
|
# This will add a version field to the +Document+ and a has_many association
|
5
5
|
# with all the versions contained in it.
|
6
6
|
module Versioning
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
include InstanceMethods
|
13
|
-
end
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
included do
|
9
|
+
field :version, :type => Integer, :default => 1
|
10
|
+
embeds_many :versions, :class_name => self.name
|
11
|
+
before_save :revise
|
14
12
|
end
|
15
13
|
module InstanceMethods
|
16
14
|
# Create a new version of the +Document+. This will load the previous
|
@@ -21,6 +19,7 @@ module Mongoid #:nodoc:
|
|
21
19
|
if last_version
|
22
20
|
self.versions << last_version.clone
|
23
21
|
self.version = version + 1
|
22
|
+
@modifications["versions"] = [ nil, @attributes["versions"] ] if @modifications
|
24
23
|
end
|
25
24
|
end
|
26
25
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 1.
|
7
|
+
- 9
|
8
|
+
- 0
|
9
|
+
version: 1.9.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Durran Jordan
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-17 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -32,66 +32,80 @@ dependencies:
|
|
32
32
|
type: :runtime
|
33
33
|
version_requirements: *id001
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
35
|
+
name: durran-validatable
|
36
36
|
prerelease: false
|
37
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
segments:
|
42
|
+
- 2
|
42
43
|
- 0
|
43
|
-
- 19
|
44
44
|
- 1
|
45
|
-
version: 0.
|
45
|
+
version: 2.0.1
|
46
46
|
type: :runtime
|
47
47
|
version_requirements: *id002
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
49
|
+
name: will_paginate
|
50
50
|
prerelease: false
|
51
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - <
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
segments:
|
56
56
|
- 2
|
57
|
-
-
|
58
|
-
|
59
|
-
version: 2.0.1
|
57
|
+
- 9
|
58
|
+
version: "2.9"
|
60
59
|
type: :runtime
|
61
60
|
version_requirements: *id003
|
62
61
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
62
|
+
name: mongo
|
64
63
|
prerelease: false
|
65
64
|
requirement: &id004 !ruby/object:Gem::Requirement
|
66
65
|
requirements:
|
67
|
-
- -
|
66
|
+
- - ~>
|
68
67
|
- !ruby/object:Gem::Version
|
69
68
|
segments:
|
70
|
-
-
|
71
|
-
-
|
72
|
-
|
69
|
+
- 1
|
70
|
+
- 0
|
71
|
+
- 1
|
72
|
+
version: 1.0.1
|
73
73
|
type: :runtime
|
74
74
|
version_requirements: *id004
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: bson
|
77
77
|
prerelease: false
|
78
78
|
requirement: &id005 !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
segments:
|
83
83
|
- 1
|
84
|
-
-
|
85
|
-
-
|
86
|
-
version: 1.
|
87
|
-
type: :
|
84
|
+
- 0
|
85
|
+
- 1
|
86
|
+
version: 1.0.1
|
87
|
+
type: :runtime
|
88
88
|
version_requirements: *id005
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
90
|
+
name: rspec
|
91
91
|
prerelease: false
|
92
92
|
requirement: &id006 !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
segments:
|
97
|
+
- 1
|
98
|
+
- 3
|
99
|
+
- 0
|
100
|
+
version: 1.3.0
|
101
|
+
type: :development
|
102
|
+
version_requirements: *id006
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: mocha
|
105
|
+
prerelease: false
|
106
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
segments:
|
97
111
|
- 0
|
@@ -99,57 +113,43 @@ dependencies:
|
|
99
113
|
- 8
|
100
114
|
version: 0.9.8
|
101
115
|
type: :development
|
102
|
-
version_requirements: *
|
103
|
-
description:
|
104
|
-
email:
|
116
|
+
version_requirements: *id007
|
117
|
+
description: Mongoid is an ODM (Object Document Mapper) Framework for MongoDB, written in Ruby.
|
118
|
+
email:
|
119
|
+
- durran@gmail.com
|
105
120
|
executables: []
|
106
121
|
|
107
122
|
extensions: []
|
108
123
|
|
109
|
-
extra_rdoc_files:
|
110
|
-
|
124
|
+
extra_rdoc_files: []
|
125
|
+
|
111
126
|
files:
|
112
|
-
- .gitignore
|
113
|
-
- .watchr
|
114
|
-
- MIT_LICENSE
|
115
|
-
- README.rdoc
|
116
|
-
- Rakefile
|
117
|
-
- VERSION
|
118
|
-
- caliper.yml
|
119
|
-
- lib/mongoid.rb
|
120
|
-
- lib/mongoid/associations.rb
|
121
|
-
- lib/mongoid/associations/belongs_to.rb
|
122
127
|
- lib/mongoid/associations/belongs_to_related.rb
|
123
|
-
- lib/mongoid/associations/
|
128
|
+
- lib/mongoid/associations/embedded_in.rb
|
129
|
+
- lib/mongoid/associations/embeds_many.rb
|
130
|
+
- lib/mongoid/associations/embeds_one.rb
|
124
131
|
- lib/mongoid/associations/has_many_related.rb
|
125
|
-
- lib/mongoid/associations/has_one.rb
|
126
132
|
- lib/mongoid/associations/has_one_related.rb
|
127
133
|
- lib/mongoid/associations/meta_data.rb
|
128
134
|
- lib/mongoid/associations/options.rb
|
129
135
|
- lib/mongoid/associations/proxy.rb
|
136
|
+
- lib/mongoid/associations.rb
|
130
137
|
- lib/mongoid/attributes.rb
|
131
138
|
- lib/mongoid/callbacks.rb
|
132
139
|
- lib/mongoid/collection.rb
|
133
140
|
- lib/mongoid/collections/cyclic_iterator.rb
|
134
141
|
- lib/mongoid/collections/master.rb
|
135
|
-
- lib/mongoid/collections/mimic.rb
|
136
142
|
- lib/mongoid/collections/operations.rb
|
137
143
|
- lib/mongoid/collections/slaves.rb
|
138
|
-
- lib/mongoid/
|
139
|
-
- lib/mongoid/commands/create.rb
|
140
|
-
- lib/mongoid/commands/delete.rb
|
141
|
-
- lib/mongoid/commands/delete_all.rb
|
142
|
-
- lib/mongoid/commands/deletion.rb
|
143
|
-
- lib/mongoid/commands/destroy.rb
|
144
|
-
- lib/mongoid/commands/destroy_all.rb
|
145
|
-
- lib/mongoid/commands/save.rb
|
144
|
+
- lib/mongoid/collections.rb
|
146
145
|
- lib/mongoid/components.rb
|
146
|
+
- lib/mongoid/concern.rb
|
147
147
|
- lib/mongoid/config.rb
|
148
|
-
- lib/mongoid/contexts.rb
|
149
148
|
- lib/mongoid/contexts/enumerable.rb
|
150
149
|
- lib/mongoid/contexts/ids.rb
|
151
150
|
- lib/mongoid/contexts/mongo.rb
|
152
151
|
- lib/mongoid/contexts/paging.rb
|
152
|
+
- lib/mongoid/contexts.rb
|
153
153
|
- lib/mongoid/criteria.rb
|
154
154
|
- lib/mongoid/criterion/complex.rb
|
155
155
|
- lib/mongoid/criterion/exclusion.rb
|
@@ -157,9 +157,9 @@ files:
|
|
157
157
|
- lib/mongoid/criterion/optional.rb
|
158
158
|
- lib/mongoid/cursor.rb
|
159
159
|
- lib/mongoid/deprecation.rb
|
160
|
+
- lib/mongoid/dirty.rb
|
160
161
|
- lib/mongoid/document.rb
|
161
162
|
- lib/mongoid/errors.rb
|
162
|
-
- lib/mongoid/extensions.rb
|
163
163
|
- lib/mongoid/extensions/array/accessors.rb
|
164
164
|
- lib/mongoid/extensions/array/aliasing.rb
|
165
165
|
- lib/mongoid/extensions/array/assimilation.rb
|
@@ -184,7 +184,8 @@ files:
|
|
184
184
|
- lib/mongoid/extensions/string/conversions.rb
|
185
185
|
- lib/mongoid/extensions/string/inflections.rb
|
186
186
|
- lib/mongoid/extensions/symbol/inflections.rb
|
187
|
-
- lib/mongoid/extensions/
|
187
|
+
- lib/mongoid/extensions/time_conversions.rb
|
188
|
+
- lib/mongoid/extensions.rb
|
188
189
|
- lib/mongoid/extras.rb
|
189
190
|
- lib/mongoid/factory.rb
|
190
191
|
- lib/mongoid/field.rb
|
@@ -192,9 +193,8 @@ files:
|
|
192
193
|
- lib/mongoid/finders.rb
|
193
194
|
- lib/mongoid/identity.rb
|
194
195
|
- lib/mongoid/indexes.rb
|
195
|
-
- lib/mongoid/javascript.rb
|
196
196
|
- lib/mongoid/javascript/functions.yml
|
197
|
-
- lib/mongoid/
|
197
|
+
- lib/mongoid/javascript.rb
|
198
198
|
- lib/mongoid/matchers/all.rb
|
199
199
|
- lib/mongoid/matchers/default.rb
|
200
200
|
- lib/mongoid/matchers/exists.rb
|
@@ -206,139 +206,34 @@ files:
|
|
206
206
|
- lib/mongoid/matchers/ne.rb
|
207
207
|
- lib/mongoid/matchers/nin.rb
|
208
208
|
- lib/mongoid/matchers/size.rb
|
209
|
+
- lib/mongoid/matchers.rb
|
209
210
|
- lib/mongoid/memoization.rb
|
210
211
|
- lib/mongoid/named_scope.rb
|
212
|
+
- lib/mongoid/observable.rb
|
213
|
+
- lib/mongoid/paths.rb
|
214
|
+
- lib/mongoid/persistence/command.rb
|
215
|
+
- lib/mongoid/persistence/insert.rb
|
216
|
+
- lib/mongoid/persistence/insert_embedded.rb
|
217
|
+
- lib/mongoid/persistence/remove.rb
|
218
|
+
- lib/mongoid/persistence/remove_all.rb
|
219
|
+
- lib/mongoid/persistence/remove_embedded.rb
|
220
|
+
- lib/mongoid/persistence/update.rb
|
221
|
+
- lib/mongoid/persistence.rb
|
211
222
|
- lib/mongoid/scope.rb
|
212
223
|
- lib/mongoid/state.rb
|
213
224
|
- lib/mongoid/timestamps.rb
|
225
|
+
- lib/mongoid/version.rb
|
214
226
|
- lib/mongoid/versioning.rb
|
215
|
-
- mongoid.
|
216
|
-
-
|
217
|
-
-
|
218
|
-
- spec/integration/mongoid/attributes_spec.rb
|
219
|
-
- spec/integration/mongoid/commands_spec.rb
|
220
|
-
- spec/integration/mongoid/contexts/enumerable_spec.rb
|
221
|
-
- spec/integration/mongoid/criteria_spec.rb
|
222
|
-
- spec/integration/mongoid/document_spec.rb
|
223
|
-
- spec/integration/mongoid/extensions_spec.rb
|
224
|
-
- spec/integration/mongoid/finders_spec.rb
|
225
|
-
- spec/integration/mongoid/inheritance_spec.rb
|
226
|
-
- spec/integration/mongoid/named_scope_spec.rb
|
227
|
-
- spec/models/address.rb
|
228
|
-
- spec/models/animal.rb
|
229
|
-
- spec/models/callbacks.rb
|
230
|
-
- spec/models/comment.rb
|
231
|
-
- spec/models/country_code.rb
|
232
|
-
- spec/models/employer.rb
|
233
|
-
- spec/models/game.rb
|
234
|
-
- spec/models/inheritance.rb
|
235
|
-
- spec/models/location.rb
|
236
|
-
- spec/models/mixed_drink.rb
|
237
|
-
- spec/models/name.rb
|
238
|
-
- spec/models/namespacing.rb
|
239
|
-
- spec/models/patient.rb
|
240
|
-
- spec/models/person.rb
|
241
|
-
- spec/models/pet.rb
|
242
|
-
- spec/models/pet_owner.rb
|
243
|
-
- spec/models/phone.rb
|
244
|
-
- spec/models/post.rb
|
245
|
-
- spec/models/translation.rb
|
246
|
-
- spec/models/vet_visit.rb
|
247
|
-
- spec/spec.opts
|
248
|
-
- spec/spec_helper.rb
|
249
|
-
- spec/unit/mongoid/associations/belongs_to_related_spec.rb
|
250
|
-
- spec/unit/mongoid/associations/belongs_to_spec.rb
|
251
|
-
- spec/unit/mongoid/associations/has_many_related_spec.rb
|
252
|
-
- spec/unit/mongoid/associations/has_many_spec.rb
|
253
|
-
- spec/unit/mongoid/associations/has_one_related_spec.rb
|
254
|
-
- spec/unit/mongoid/associations/has_one_spec.rb
|
255
|
-
- spec/unit/mongoid/associations/meta_data_spec.rb
|
256
|
-
- spec/unit/mongoid/associations/options_spec.rb
|
257
|
-
- spec/unit/mongoid/associations_spec.rb
|
258
|
-
- spec/unit/mongoid/attributes_spec.rb
|
259
|
-
- spec/unit/mongoid/callbacks_spec.rb
|
260
|
-
- spec/unit/mongoid/collection_spec.rb
|
261
|
-
- spec/unit/mongoid/collections/cyclic_iterator_spec.rb
|
262
|
-
- spec/unit/mongoid/collections/master_spec.rb
|
263
|
-
- spec/unit/mongoid/collections/mimic_spec.rb
|
264
|
-
- spec/unit/mongoid/collections/slaves_spec.rb
|
265
|
-
- spec/unit/mongoid/commands/create_spec.rb
|
266
|
-
- spec/unit/mongoid/commands/delete_all_spec.rb
|
267
|
-
- spec/unit/mongoid/commands/delete_spec.rb
|
268
|
-
- spec/unit/mongoid/commands/destroy_all_spec.rb
|
269
|
-
- spec/unit/mongoid/commands/destroy_spec.rb
|
270
|
-
- spec/unit/mongoid/commands/save_spec.rb
|
271
|
-
- spec/unit/mongoid/commands_spec.rb
|
272
|
-
- spec/unit/mongoid/config_spec.rb
|
273
|
-
- spec/unit/mongoid/contexts/enumerable_spec.rb
|
274
|
-
- spec/unit/mongoid/contexts/mongo_spec.rb
|
275
|
-
- spec/unit/mongoid/contexts_spec.rb
|
276
|
-
- spec/unit/mongoid/criteria_spec.rb
|
277
|
-
- spec/unit/mongoid/criterion/complex_spec.rb
|
278
|
-
- spec/unit/mongoid/criterion/exclusion_spec.rb
|
279
|
-
- spec/unit/mongoid/criterion/inclusion_spec.rb
|
280
|
-
- spec/unit/mongoid/criterion/optional_spec.rb
|
281
|
-
- spec/unit/mongoid/cursor_spec.rb
|
282
|
-
- spec/unit/mongoid/deprecation_spec.rb
|
283
|
-
- spec/unit/mongoid/document_spec.rb
|
284
|
-
- spec/unit/mongoid/errors_spec.rb
|
285
|
-
- spec/unit/mongoid/extensions/array/accessors_spec.rb
|
286
|
-
- spec/unit/mongoid/extensions/array/assimilation_spec.rb
|
287
|
-
- spec/unit/mongoid/extensions/array/conversions_spec.rb
|
288
|
-
- spec/unit/mongoid/extensions/array/parentization_spec.rb
|
289
|
-
- spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb
|
290
|
-
- spec/unit/mongoid/extensions/binary/conversions_spec.rb
|
291
|
-
- spec/unit/mongoid/extensions/boolean/conversions_spec.rb
|
292
|
-
- spec/unit/mongoid/extensions/date/conversions_spec.rb
|
293
|
-
- spec/unit/mongoid/extensions/datetime/conversions_spec.rb
|
294
|
-
- spec/unit/mongoid/extensions/float/conversions_spec.rb
|
295
|
-
- spec/unit/mongoid/extensions/hash/accessors_spec.rb
|
296
|
-
- spec/unit/mongoid/extensions/hash/assimilation_spec.rb
|
297
|
-
- spec/unit/mongoid/extensions/hash/conversions_spec.rb
|
298
|
-
- spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
|
299
|
-
- spec/unit/mongoid/extensions/hash/scoping_spec.rb
|
300
|
-
- spec/unit/mongoid/extensions/integer/conversions_spec.rb
|
301
|
-
- spec/unit/mongoid/extensions/nil/assimilation_spec.rb
|
302
|
-
- spec/unit/mongoid/extensions/object/conversions_spec.rb
|
303
|
-
- spec/unit/mongoid/extensions/proc/scoping_spec.rb
|
304
|
-
- spec/unit/mongoid/extensions/string/conversions_spec.rb
|
305
|
-
- spec/unit/mongoid/extensions/string/inflections_spec.rb
|
306
|
-
- spec/unit/mongoid/extensions/symbol/inflections_spec.rb
|
307
|
-
- spec/unit/mongoid/extensions/time/conversions_spec.rb
|
308
|
-
- spec/unit/mongoid/extras_spec.rb
|
309
|
-
- spec/unit/mongoid/factory_spec.rb
|
310
|
-
- spec/unit/mongoid/field_spec.rb
|
311
|
-
- spec/unit/mongoid/fields_spec.rb
|
312
|
-
- spec/unit/mongoid/finders_spec.rb
|
313
|
-
- spec/unit/mongoid/identity_spec.rb
|
314
|
-
- spec/unit/mongoid/indexes_spec.rb
|
315
|
-
- spec/unit/mongoid/javascript_spec.rb
|
316
|
-
- spec/unit/mongoid/matchers/all_spec.rb
|
317
|
-
- spec/unit/mongoid/matchers/default_spec.rb
|
318
|
-
- spec/unit/mongoid/matchers/exists_spec.rb
|
319
|
-
- spec/unit/mongoid/matchers/gt_spec.rb
|
320
|
-
- spec/unit/mongoid/matchers/gte_spec.rb
|
321
|
-
- spec/unit/mongoid/matchers/in_spec.rb
|
322
|
-
- spec/unit/mongoid/matchers/lt_spec.rb
|
323
|
-
- spec/unit/mongoid/matchers/lte_spec.rb
|
324
|
-
- spec/unit/mongoid/matchers/ne_spec.rb
|
325
|
-
- spec/unit/mongoid/matchers/nin_spec.rb
|
326
|
-
- spec/unit/mongoid/matchers/size_spec.rb
|
327
|
-
- spec/unit/mongoid/matchers_spec.rb
|
328
|
-
- spec/unit/mongoid/memoization_spec.rb
|
329
|
-
- spec/unit/mongoid/named_scope_spec.rb
|
330
|
-
- spec/unit/mongoid/scope_spec.rb
|
331
|
-
- spec/unit/mongoid/state_spec.rb
|
332
|
-
- spec/unit/mongoid/timestamps_spec.rb
|
333
|
-
- spec/unit/mongoid/versioning_spec.rb
|
334
|
-
- spec/unit/mongoid_spec.rb
|
227
|
+
- lib/mongoid.rb
|
228
|
+
- MIT_LICENSE
|
229
|
+
- README.rdoc
|
335
230
|
has_rdoc: true
|
336
231
|
homepage: http://mongoid.org
|
337
232
|
licenses: []
|
338
233
|
|
339
234
|
post_install_message:
|
340
|
-
rdoc_options:
|
341
|
-
|
235
|
+
rdoc_options: []
|
236
|
+
|
342
237
|
require_paths:
|
343
238
|
- lib
|
344
239
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -353,130 +248,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
353
248
|
- - ">="
|
354
249
|
- !ruby/object:Gem::Version
|
355
250
|
segments:
|
356
|
-
-
|
357
|
-
|
251
|
+
- 1
|
252
|
+
- 3
|
253
|
+
- 6
|
254
|
+
version: 1.3.6
|
358
255
|
requirements: []
|
359
256
|
|
360
|
-
rubyforge_project:
|
257
|
+
rubyforge_project: mongoid
|
361
258
|
rubygems_version: 1.3.6
|
362
259
|
signing_key:
|
363
260
|
specification_version: 3
|
364
|
-
summary:
|
365
|
-
test_files:
|
366
|
-
|
367
|
-
- spec/integration/mongoid/attributes_spec.rb
|
368
|
-
- spec/integration/mongoid/commands_spec.rb
|
369
|
-
- spec/integration/mongoid/contexts/enumerable_spec.rb
|
370
|
-
- spec/integration/mongoid/criteria_spec.rb
|
371
|
-
- spec/integration/mongoid/document_spec.rb
|
372
|
-
- spec/integration/mongoid/extensions_spec.rb
|
373
|
-
- spec/integration/mongoid/finders_spec.rb
|
374
|
-
- spec/integration/mongoid/inheritance_spec.rb
|
375
|
-
- spec/integration/mongoid/named_scope_spec.rb
|
376
|
-
- spec/models/address.rb
|
377
|
-
- spec/models/animal.rb
|
378
|
-
- spec/models/callbacks.rb
|
379
|
-
- spec/models/comment.rb
|
380
|
-
- spec/models/country_code.rb
|
381
|
-
- spec/models/employer.rb
|
382
|
-
- spec/models/game.rb
|
383
|
-
- spec/models/inheritance.rb
|
384
|
-
- spec/models/location.rb
|
385
|
-
- spec/models/mixed_drink.rb
|
386
|
-
- spec/models/name.rb
|
387
|
-
- spec/models/namespacing.rb
|
388
|
-
- spec/models/patient.rb
|
389
|
-
- spec/models/person.rb
|
390
|
-
- spec/models/pet.rb
|
391
|
-
- spec/models/pet_owner.rb
|
392
|
-
- spec/models/phone.rb
|
393
|
-
- spec/models/post.rb
|
394
|
-
- spec/models/translation.rb
|
395
|
-
- spec/models/vet_visit.rb
|
396
|
-
- spec/spec_helper.rb
|
397
|
-
- spec/unit/mongoid/associations/belongs_to_related_spec.rb
|
398
|
-
- spec/unit/mongoid/associations/belongs_to_spec.rb
|
399
|
-
- spec/unit/mongoid/associations/has_many_related_spec.rb
|
400
|
-
- spec/unit/mongoid/associations/has_many_spec.rb
|
401
|
-
- spec/unit/mongoid/associations/has_one_related_spec.rb
|
402
|
-
- spec/unit/mongoid/associations/has_one_spec.rb
|
403
|
-
- spec/unit/mongoid/associations/meta_data_spec.rb
|
404
|
-
- spec/unit/mongoid/associations/options_spec.rb
|
405
|
-
- spec/unit/mongoid/associations_spec.rb
|
406
|
-
- spec/unit/mongoid/attributes_spec.rb
|
407
|
-
- spec/unit/mongoid/callbacks_spec.rb
|
408
|
-
- spec/unit/mongoid/collection_spec.rb
|
409
|
-
- spec/unit/mongoid/collections/cyclic_iterator_spec.rb
|
410
|
-
- spec/unit/mongoid/collections/master_spec.rb
|
411
|
-
- spec/unit/mongoid/collections/mimic_spec.rb
|
412
|
-
- spec/unit/mongoid/collections/slaves_spec.rb
|
413
|
-
- spec/unit/mongoid/commands/create_spec.rb
|
414
|
-
- spec/unit/mongoid/commands/delete_all_spec.rb
|
415
|
-
- spec/unit/mongoid/commands/delete_spec.rb
|
416
|
-
- spec/unit/mongoid/commands/destroy_all_spec.rb
|
417
|
-
- spec/unit/mongoid/commands/destroy_spec.rb
|
418
|
-
- spec/unit/mongoid/commands/save_spec.rb
|
419
|
-
- spec/unit/mongoid/commands_spec.rb
|
420
|
-
- spec/unit/mongoid/config_spec.rb
|
421
|
-
- spec/unit/mongoid/contexts/enumerable_spec.rb
|
422
|
-
- spec/unit/mongoid/contexts/mongo_spec.rb
|
423
|
-
- spec/unit/mongoid/contexts_spec.rb
|
424
|
-
- spec/unit/mongoid/criteria_spec.rb
|
425
|
-
- spec/unit/mongoid/criterion/complex_spec.rb
|
426
|
-
- spec/unit/mongoid/criterion/exclusion_spec.rb
|
427
|
-
- spec/unit/mongoid/criterion/inclusion_spec.rb
|
428
|
-
- spec/unit/mongoid/criterion/optional_spec.rb
|
429
|
-
- spec/unit/mongoid/cursor_spec.rb
|
430
|
-
- spec/unit/mongoid/deprecation_spec.rb
|
431
|
-
- spec/unit/mongoid/document_spec.rb
|
432
|
-
- spec/unit/mongoid/errors_spec.rb
|
433
|
-
- spec/unit/mongoid/extensions/array/accessors_spec.rb
|
434
|
-
- spec/unit/mongoid/extensions/array/assimilation_spec.rb
|
435
|
-
- spec/unit/mongoid/extensions/array/conversions_spec.rb
|
436
|
-
- spec/unit/mongoid/extensions/array/parentization_spec.rb
|
437
|
-
- spec/unit/mongoid/extensions/big_decimal/conversions_spec.rb
|
438
|
-
- spec/unit/mongoid/extensions/binary/conversions_spec.rb
|
439
|
-
- spec/unit/mongoid/extensions/boolean/conversions_spec.rb
|
440
|
-
- spec/unit/mongoid/extensions/date/conversions_spec.rb
|
441
|
-
- spec/unit/mongoid/extensions/datetime/conversions_spec.rb
|
442
|
-
- spec/unit/mongoid/extensions/float/conversions_spec.rb
|
443
|
-
- spec/unit/mongoid/extensions/hash/accessors_spec.rb
|
444
|
-
- spec/unit/mongoid/extensions/hash/assimilation_spec.rb
|
445
|
-
- spec/unit/mongoid/extensions/hash/conversions_spec.rb
|
446
|
-
- spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
|
447
|
-
- spec/unit/mongoid/extensions/hash/scoping_spec.rb
|
448
|
-
- spec/unit/mongoid/extensions/integer/conversions_spec.rb
|
449
|
-
- spec/unit/mongoid/extensions/nil/assimilation_spec.rb
|
450
|
-
- spec/unit/mongoid/extensions/object/conversions_spec.rb
|
451
|
-
- spec/unit/mongoid/extensions/proc/scoping_spec.rb
|
452
|
-
- spec/unit/mongoid/extensions/string/conversions_spec.rb
|
453
|
-
- spec/unit/mongoid/extensions/string/inflections_spec.rb
|
454
|
-
- spec/unit/mongoid/extensions/symbol/inflections_spec.rb
|
455
|
-
- spec/unit/mongoid/extensions/time/conversions_spec.rb
|
456
|
-
- spec/unit/mongoid/extras_spec.rb
|
457
|
-
- spec/unit/mongoid/factory_spec.rb
|
458
|
-
- spec/unit/mongoid/field_spec.rb
|
459
|
-
- spec/unit/mongoid/fields_spec.rb
|
460
|
-
- spec/unit/mongoid/finders_spec.rb
|
461
|
-
- spec/unit/mongoid/identity_spec.rb
|
462
|
-
- spec/unit/mongoid/indexes_spec.rb
|
463
|
-
- spec/unit/mongoid/javascript_spec.rb
|
464
|
-
- spec/unit/mongoid/matchers/all_spec.rb
|
465
|
-
- spec/unit/mongoid/matchers/default_spec.rb
|
466
|
-
- spec/unit/mongoid/matchers/exists_spec.rb
|
467
|
-
- spec/unit/mongoid/matchers/gt_spec.rb
|
468
|
-
- spec/unit/mongoid/matchers/gte_spec.rb
|
469
|
-
- spec/unit/mongoid/matchers/in_spec.rb
|
470
|
-
- spec/unit/mongoid/matchers/lt_spec.rb
|
471
|
-
- spec/unit/mongoid/matchers/lte_spec.rb
|
472
|
-
- spec/unit/mongoid/matchers/ne_spec.rb
|
473
|
-
- spec/unit/mongoid/matchers/nin_spec.rb
|
474
|
-
- spec/unit/mongoid/matchers/size_spec.rb
|
475
|
-
- spec/unit/mongoid/matchers_spec.rb
|
476
|
-
- spec/unit/mongoid/memoization_spec.rb
|
477
|
-
- spec/unit/mongoid/named_scope_spec.rb
|
478
|
-
- spec/unit/mongoid/scope_spec.rb
|
479
|
-
- spec/unit/mongoid/state_spec.rb
|
480
|
-
- spec/unit/mongoid/timestamps_spec.rb
|
481
|
-
- spec/unit/mongoid/versioning_spec.rb
|
482
|
-
- spec/unit/mongoid_spec.rb
|
261
|
+
summary: Elegent Persistance in Ruby for MongoDB.
|
262
|
+
test_files: []
|
263
|
+
|