mongoid 2.0.0.rc.7 → 2.0.0.rc.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/config/locales/en.yml +3 -0
- data/lib/config/locales/id.yml +46 -0
- data/lib/config/locales/ja.yml +40 -0
- data/lib/config/locales/vi.yml +45 -0
- data/lib/mongoid.rb +5 -3
- data/lib/mongoid/attributes.rb +24 -63
- data/lib/mongoid/attributes/processing.rb +5 -2
- data/lib/mongoid/callbacks.rb +10 -0
- data/lib/mongoid/collection.rb +24 -0
- data/lib/mongoid/collections/master.rb +14 -6
- data/lib/mongoid/collections/operations.rb +1 -1
- data/lib/mongoid/collections/retry.rb +39 -0
- data/lib/mongoid/collections/slaves.rb +26 -10
- data/lib/mongoid/components.rb +4 -4
- data/lib/mongoid/config.rb +6 -3
- data/lib/mongoid/contexts.rb +0 -1
- data/lib/mongoid/contexts/enumerable.rb +19 -7
- data/lib/mongoid/contexts/mongo.rb +9 -5
- data/lib/mongoid/copyable.rb +10 -8
- data/lib/mongoid/criteria.rb +83 -61
- data/lib/mongoid/criterion/builder.rb +34 -0
- data/lib/mongoid/criterion/creational.rb +2 -2
- data/lib/mongoid/criterion/exclusion.rb +58 -32
- data/lib/mongoid/criterion/inclusion.rb +49 -10
- data/lib/mongoid/criterion/optional.rb +1 -1
- data/lib/mongoid/criterion/selector.rb +80 -11
- data/lib/mongoid/cursor.rb +6 -1
- data/lib/mongoid/default_scope.rb +27 -19
- data/lib/mongoid/document.rb +26 -1
- data/lib/mongoid/errors.rb +1 -0
- data/lib/mongoid/errors/mixed_relations.rb +37 -0
- data/lib/mongoid/extensions/object_id/conversions.rb +7 -4
- data/lib/mongoid/factory.rb +1 -1
- data/lib/mongoid/field.rb +47 -30
- data/lib/mongoid/fields.rb +9 -2
- data/lib/mongoid/finders.rb +15 -49
- data/lib/mongoid/identity.rb +6 -4
- data/lib/mongoid/keys.rb +85 -31
- data/lib/mongoid/multi_parameter_attributes.rb +2 -2
- data/lib/mongoid/named_scope.rb +129 -28
- data/lib/mongoid/observer.rb +36 -0
- data/lib/mongoid/paranoia.rb +3 -3
- data/lib/mongoid/paths.rb +1 -1
- data/lib/mongoid/persistence.rb +2 -0
- data/lib/mongoid/persistence/atomic.rb +88 -0
- data/lib/mongoid/persistence/atomic/add_to_set.rb +30 -0
- data/lib/mongoid/persistence/atomic/inc.rb +28 -0
- data/lib/mongoid/persistence/atomic/operation.rb +44 -0
- data/lib/mongoid/persistence/atomic/pull_all.rb +33 -0
- data/lib/mongoid/persistence/atomic/push.rb +28 -0
- data/lib/mongoid/railtie.rb +13 -1
- data/lib/mongoid/relations.rb +1 -0
- data/lib/mongoid/relations/accessors.rb +20 -2
- data/lib/mongoid/relations/builders/embedded/one.rb +1 -0
- data/lib/mongoid/relations/builders/nested_attributes/many.rb +17 -6
- data/lib/mongoid/relations/builders/referenced/many.rb +2 -1
- data/lib/mongoid/relations/builders/referenced/one.rb +1 -0
- data/lib/mongoid/relations/embedded/atomic.rb +86 -0
- data/lib/mongoid/relations/embedded/atomic/operation.rb +63 -0
- data/lib/mongoid/relations/embedded/atomic/pull.rb +65 -0
- data/lib/mongoid/relations/embedded/atomic/push_all.rb +59 -0
- data/lib/mongoid/relations/embedded/atomic/set.rb +61 -0
- data/lib/mongoid/relations/embedded/atomic/unset.rb +41 -0
- data/lib/mongoid/relations/embedded/many.rb +57 -25
- data/lib/mongoid/relations/macros.rb +6 -4
- data/lib/mongoid/relations/many.rb +51 -10
- data/lib/mongoid/relations/metadata.rb +4 -2
- data/lib/mongoid/relations/proxy.rb +39 -24
- data/lib/mongoid/relations/referenced/many.rb +47 -26
- data/lib/mongoid/relations/referenced/many_to_many.rb +47 -14
- data/lib/mongoid/relations/referenced/one.rb +14 -0
- data/lib/mongoid/sharding.rb +51 -0
- data/lib/mongoid/state.rb +3 -2
- data/lib/mongoid/timestamps.rb +5 -29
- data/lib/mongoid/timestamps/created.rb +31 -0
- data/lib/mongoid/timestamps/updated.rb +33 -0
- data/lib/mongoid/validations.rb +10 -3
- data/lib/mongoid/validations/referenced.rb +58 -0
- data/lib/mongoid/version.rb +1 -1
- data/lib/mongoid/versioning.rb +67 -5
- data/lib/rails/generators/mongoid/model/templates/model.rb +2 -0
- data/lib/rails/generators/mongoid/observer/observer_generator.rb +17 -0
- data/lib/rails/generators/mongoid/observer/templates/observer.rb +4 -0
- data/lib/rails/generators/mongoid_generator.rb +10 -1
- data/lib/rails/mongoid.rb +1 -0
- metadata +29 -8
- data/lib/mongoid/contexts/ids.rb +0 -25
- data/lib/mongoid/modifiers.rb +0 -24
- data/lib/mongoid/modifiers/command.rb +0 -18
- data/lib/mongoid/modifiers/inc.rb +0 -24
data/lib/mongoid/state.rb
CHANGED
@@ -30,14 +30,15 @@ module Mongoid #:nodoc:
|
|
30
30
|
@new_record = saved
|
31
31
|
end
|
32
32
|
|
33
|
-
# Checks if the document has been saved to the database.
|
33
|
+
# Checks if the document has been saved to the database. Returns false
|
34
|
+
# if the document has been destroyed.
|
34
35
|
#
|
35
36
|
# @example Is the document persisted?
|
36
37
|
# person.persisted?
|
37
38
|
#
|
38
39
|
# @return [ true, false ] True if persisted, false if not.
|
39
40
|
def persisted?
|
40
|
-
!new_record?
|
41
|
+
!new_record? && !destroyed?
|
41
42
|
end
|
42
43
|
|
43
44
|
# Returns true if the +Document+ has been succesfully destroyed, and false
|
data/lib/mongoid/timestamps.rb
CHANGED
@@ -1,38 +1,14 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
require "mongoid/timestamps/created"
|
3
|
+
require "mongoid/timestamps/updated"
|
4
|
+
|
2
5
|
module Mongoid #:nodoc:
|
3
6
|
|
4
7
|
# This module handles the behaviour for setting up document created at and
|
5
8
|
# updated at timestamps.
|
6
9
|
module Timestamps
|
7
10
|
extend ActiveSupport::Concern
|
8
|
-
|
9
|
-
|
10
|
-
field :created_at, :type => Time
|
11
|
-
field :updated_at, :type => Time
|
12
|
-
|
13
|
-
set_callback :create, :before, :set_created_at
|
14
|
-
set_callback :save, :before, :set_updated_at, :if => Proc.new {|d| d.new_record? || d.changed? }
|
15
|
-
|
16
|
-
class_attribute :record_timestamps
|
17
|
-
self.record_timestamps = true
|
18
|
-
end
|
19
|
-
|
20
|
-
# Update the created_at field on the Document to the current time. This is
|
21
|
-
# only called on create.
|
22
|
-
#
|
23
|
-
# @example Set the created at time.
|
24
|
-
# person.set_created_at
|
25
|
-
def set_created_at
|
26
|
-
self.created_at = Time.now.utc if !created_at
|
27
|
-
end
|
28
|
-
|
29
|
-
# Update the updated_at field on the Document to the current time.
|
30
|
-
# This is only called on create and on save.
|
31
|
-
#
|
32
|
-
# @example Set the updated at time.
|
33
|
-
# person.set_updated_at
|
34
|
-
def set_updated_at
|
35
|
-
self.updated_at = Time.now.utc
|
36
|
-
end
|
11
|
+
include Created
|
12
|
+
include Updated
|
37
13
|
end
|
38
14
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
|
4
|
+
module Timestamps
|
5
|
+
# This module handles the behaviour for setting up document created at
|
6
|
+
# timestamp.
|
7
|
+
module Created
|
8
|
+
extend ActiveSupport::Concern
|
9
|
+
|
10
|
+
included do
|
11
|
+
field :created_at, :type => Time
|
12
|
+
|
13
|
+
set_callback :create, :before, :set_created_at
|
14
|
+
|
15
|
+
unless methods.include? 'record_timestamps'
|
16
|
+
class_attribute :record_timestamps
|
17
|
+
self.record_timestamps = true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# Update the created_at field on the Document to the current time. This is
|
22
|
+
# only called on create.
|
23
|
+
#
|
24
|
+
# @example Set the created at time.
|
25
|
+
# person.set_created_at
|
26
|
+
def set_created_at
|
27
|
+
self.created_at = Time.now.utc if !created_at
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
|
4
|
+
module Timestamps
|
5
|
+
# This module handles the behaviour for setting up document updated at
|
6
|
+
# timestamp.
|
7
|
+
module Updated
|
8
|
+
extend ActiveSupport::Concern
|
9
|
+
|
10
|
+
included do
|
11
|
+
field :updated_at, :type => Time
|
12
|
+
|
13
|
+
set_callback :save, :before, :set_updated_at, :if => Proc.new { |doc|
|
14
|
+
doc.new_record? || doc.changed?
|
15
|
+
}
|
16
|
+
|
17
|
+
unless methods.include? 'record_timestamps'
|
18
|
+
class_attribute :record_timestamps
|
19
|
+
self.record_timestamps = true
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# Update the updated_at field on the Document to the current time.
|
24
|
+
# This is only called on create and on save.
|
25
|
+
#
|
26
|
+
# @example Set the updated at time.
|
27
|
+
# person.set_updated_at
|
28
|
+
def set_updated_at
|
29
|
+
self.updated_at = Time.now.utc
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/mongoid/validations.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "mongoid/validations/associated"
|
3
|
+
require "mongoid/validations/referenced"
|
3
4
|
require "mongoid/validations/uniqueness"
|
4
5
|
|
5
6
|
module Mongoid #:nodoc:
|
@@ -104,13 +105,19 @@ module Mongoid #:nodoc:
|
|
104
105
|
# was not provided or set to true.
|
105
106
|
#
|
106
107
|
# @example Set up validation.
|
107
|
-
# Person.
|
108
|
+
# Person.validates_relation(metadata)
|
108
109
|
#
|
109
110
|
# @param [ Metadata ] metadata The relation metadata.
|
110
111
|
#
|
111
112
|
# @since 2.0.0.rc.1
|
112
|
-
def
|
113
|
-
|
113
|
+
def validates_relation(metadata)
|
114
|
+
if metadata.validate?
|
115
|
+
if metadata.embedded?
|
116
|
+
validates_associated(metadata.name)
|
117
|
+
else
|
118
|
+
validates_with(ReferencedValidator, _merge_attributes([metadata.name]))
|
119
|
+
end
|
120
|
+
end
|
114
121
|
end
|
115
122
|
end
|
116
123
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Mongoid #:nodoc:
|
3
|
+
module Validations #:nodoc:
|
4
|
+
|
5
|
+
# Validates whether or not an association is valid or not. Will correctly
|
6
|
+
# handle has one and has many associations. Will *not* load associations if
|
7
|
+
# they aren't already in memory.
|
8
|
+
#
|
9
|
+
# @example Set up the association validations.
|
10
|
+
#
|
11
|
+
# class Person
|
12
|
+
# include Mongoid::Document
|
13
|
+
# references_many :posts, :validate => true
|
14
|
+
# end
|
15
|
+
class ReferencedValidator < ActiveModel::EachValidator
|
16
|
+
|
17
|
+
# Validate the document for the initialized attributes. Will not load
|
18
|
+
# any association that's not currently loaded.
|
19
|
+
#
|
20
|
+
# @param [ Document ] document The document to validate.
|
21
|
+
def validate(document)
|
22
|
+
attributes.each do |attribute|
|
23
|
+
value = document.instance_variable_get("@#{attribute}".to_sym)
|
24
|
+
validate_each(document, attribute, value)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# Validates that the already loaded associations provided are either all
|
29
|
+
# nil or unchanged or all valid. If neither is true then the appropriate
|
30
|
+
# errors will be added to the parent document.
|
31
|
+
#
|
32
|
+
# @example Validate the loaded association.
|
33
|
+
# validator.validate_each(document, :name, name)
|
34
|
+
#
|
35
|
+
# @param [ Document ] document The document to validate.
|
36
|
+
# @param [ Symbol ] attribute The relation to validate.
|
37
|
+
# @param [ Object ] value The value of the relation.
|
38
|
+
def validate_each(document, attribute, value)
|
39
|
+
document.validated = true
|
40
|
+
valid =
|
41
|
+
if !value || !value.target
|
42
|
+
true
|
43
|
+
else
|
44
|
+
Array.wrap(value).collect do |doc|
|
45
|
+
if doc.nil? || (!doc.changed? && !doc.new_record?)
|
46
|
+
true
|
47
|
+
else
|
48
|
+
doc.validated? ? true : doc.valid?
|
49
|
+
end
|
50
|
+
end.all?
|
51
|
+
end
|
52
|
+
document.validated = false
|
53
|
+
return if valid
|
54
|
+
document.errors.add(attribute, :invalid, options.merge(:value => value))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/mongoid/version.rb
CHANGED
data/lib/mongoid/versioning.rb
CHANGED
@@ -9,9 +9,11 @@ module Mongoid #:nodoc:
|
|
9
9
|
|
10
10
|
included do
|
11
11
|
field :version, :type => Integer, :default => 1
|
12
|
+
|
12
13
|
embeds_many :versions, :class_name => self.name, :validate => false
|
13
|
-
set_callback :save, :before, :revise, :if => :
|
14
|
+
set_callback :save, :before, :revise, :if => :revisable?
|
14
15
|
|
16
|
+
class_attribute :version_max
|
15
17
|
delegate :version_max, :to => "self.class"
|
16
18
|
end
|
17
19
|
|
@@ -22,18 +24,78 @@ module Mongoid #:nodoc:
|
|
22
24
|
#
|
23
25
|
# @example Revise the document.
|
24
26
|
# person.revise
|
27
|
+
#
|
28
|
+
# @since 1.0.0
|
25
29
|
def revise
|
26
|
-
|
27
|
-
if
|
28
|
-
versions.target <<
|
30
|
+
previous = find_last_version
|
31
|
+
if previous
|
32
|
+
versions.target << previous.clone
|
29
33
|
versions.shift if version_max.present? && versions.length > version_max
|
30
34
|
self.version = (version || 1 ) + 1
|
31
35
|
@modifications["versions"] = [ nil, versions.as_document ] if @modifications
|
32
36
|
end
|
33
37
|
end
|
34
38
|
|
39
|
+
# Executes a block that temporarily disables versioning. This is for cases
|
40
|
+
# where you do not want to version on every save.
|
41
|
+
#
|
42
|
+
# @example Execute a save without versioning.
|
43
|
+
# person.versionless(&:save)
|
44
|
+
#
|
45
|
+
# @return [ Object ] The document or result of the block execution.
|
46
|
+
#
|
47
|
+
# @since 2.0.0
|
48
|
+
def versionless
|
49
|
+
@versionless = true
|
50
|
+
result = yield(self) if block_given?
|
51
|
+
@versionless = false
|
52
|
+
result || self
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
# Find the previous version of this document in the database, or if the
|
58
|
+
# document had been saved without versioning return the persisted one.
|
59
|
+
#
|
60
|
+
# @example Find the last version.
|
61
|
+
# document.find_last_version
|
62
|
+
#
|
63
|
+
# @return [ Document, nil ] The previously saved document.
|
64
|
+
#
|
65
|
+
# @since 2.0.0
|
66
|
+
def find_last_version
|
67
|
+
self.class.
|
68
|
+
where(:_id => id).
|
69
|
+
any_of({ :version => version }, { :version => nil }).first
|
70
|
+
end
|
71
|
+
|
72
|
+
# Is the document able to be revised? This is true if the document has
|
73
|
+
# changed and we have not explicitly told it not to version.
|
74
|
+
#
|
75
|
+
# @example Is the document revisable?
|
76
|
+
# document.revisable?
|
77
|
+
#
|
78
|
+
# @return [ true, false ] If the document is revisable.
|
79
|
+
#
|
80
|
+
# @since 2.0.0
|
81
|
+
def revisable?
|
82
|
+
changed? && !versionless?
|
83
|
+
end
|
84
|
+
|
85
|
+
# Are we in versionless mode? This is true if in a versionless block on the
|
86
|
+
# document.
|
87
|
+
#
|
88
|
+
# @example Is the document in versionless mode?
|
89
|
+
# document.versionless?
|
90
|
+
#
|
91
|
+
# @return [ true, false ] Is the document not currently versioning.
|
92
|
+
#
|
93
|
+
# @since 2.0.0
|
94
|
+
def versionless?
|
95
|
+
!!@versionless
|
96
|
+
end
|
97
|
+
|
35
98
|
module ClassMethods #:nodoc:
|
36
|
-
attr_accessor :version_max
|
37
99
|
|
38
100
|
# Sets the maximum number of versions to store.
|
39
101
|
#
|
@@ -1,3 +1,4 @@
|
|
1
|
+
<% module_namespacing do -%>
|
1
2
|
class <%= class_name %><%= " < #{options[:parent].classify}" if options[:parent] %>
|
2
3
|
<% unless options[:parent] -%>
|
3
4
|
include Mongoid::Document
|
@@ -15,3 +16,4 @@ class <%= class_name %><%= " < #{options[:parent].classify}" if options[:parent]
|
|
15
16
|
embedded_in :<%= attribute.name%>, :inverse_of => :<%= class_name.tableize %>
|
16
17
|
<% end -%>
|
17
18
|
end
|
19
|
+
<% end -%>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "rails/generators/mongoid_generator"
|
3
|
+
|
4
|
+
module Mongoid #:nodoc:
|
5
|
+
module Generators #:nodoc:
|
6
|
+
class ObserverGenerator < Base #:nodoc:
|
7
|
+
|
8
|
+
check_class_collision :suffix => "Observer"
|
9
|
+
|
10
|
+
def create_observer_file
|
11
|
+
template 'observer.rb', File.join('app/models', class_path, "#{file_name}_observer.rb")
|
12
|
+
end
|
13
|
+
|
14
|
+
hook_for :test_framework
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -8,7 +8,16 @@ module Mongoid #:nodoc:
|
|
8
8
|
|
9
9
|
def self.source_root
|
10
10
|
@_mongoid_source_root ||=
|
11
|
-
|
11
|
+
File.expand_path("../#{base_name}/#{generator_name}/templates", __FILE__)
|
12
|
+
end
|
13
|
+
|
14
|
+
unless methods.include?(:module_namespacing)
|
15
|
+
|
16
|
+
# This is only defined on Rails edge at the moment, so include here now
|
17
|
+
# as per: https://github.com/mongoid/mongoid/issues/744
|
18
|
+
def module_namespacing(&block)
|
19
|
+
yield if block
|
20
|
+
end
|
12
21
|
end
|
13
22
|
end
|
14
23
|
|
data/lib/rails/mongoid.rb
CHANGED
@@ -12,6 +12,7 @@ module Rails #:nodoc:
|
|
12
12
|
#
|
13
13
|
# @param [ Application ] app The rails application.
|
14
14
|
def load_models(app)
|
15
|
+
return unless ::Mongoid.preload_models
|
15
16
|
app.config.paths["app/models"].each do |path|
|
16
17
|
Dir.glob("#{path}/**/*.rb").sort.each do |file|
|
17
18
|
load_model(file.gsub("#{path}/" , "").gsub(".rb", ""))
|
metadata
CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
|
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- rc
|
10
|
-
-
|
11
|
-
version: 2.0.0.rc.
|
10
|
+
- 8
|
11
|
+
version: 2.0.0.rc.8
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Durran Jordan
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-03-23 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -150,7 +150,9 @@ files:
|
|
150
150
|
- lib/config/locales/es.yml
|
151
151
|
- lib/config/locales/fr.yml
|
152
152
|
- lib/config/locales/hu.yml
|
153
|
+
- lib/config/locales/id.yml
|
153
154
|
- lib/config/locales/it.yml
|
155
|
+
- lib/config/locales/ja.yml
|
154
156
|
- lib/config/locales/kr.yml
|
155
157
|
- lib/config/locales/nl.yml
|
156
158
|
- lib/config/locales/pl.yml
|
@@ -159,6 +161,7 @@ files:
|
|
159
161
|
- lib/config/locales/ro.yml
|
160
162
|
- lib/config/locales/ru.yml
|
161
163
|
- lib/config/locales/sv.yml
|
164
|
+
- lib/config/locales/vi.yml
|
162
165
|
- lib/config/locales/zh-CN.yml
|
163
166
|
- lib/mongoid/atomicity.rb
|
164
167
|
- lib/mongoid/attributes/processing.rb
|
@@ -168,6 +171,7 @@ files:
|
|
168
171
|
- lib/mongoid/collections/cyclic_iterator.rb
|
169
172
|
- lib/mongoid/collections/master.rb
|
170
173
|
- lib/mongoid/collections/operations.rb
|
174
|
+
- lib/mongoid/collections/retry.rb
|
171
175
|
- lib/mongoid/collections/slaves.rb
|
172
176
|
- lib/mongoid/collections.rb
|
173
177
|
- lib/mongoid/components.rb
|
@@ -176,12 +180,12 @@ files:
|
|
176
180
|
- lib/mongoid/config.rb
|
177
181
|
- lib/mongoid/contexts/enumerable/sort.rb
|
178
182
|
- lib/mongoid/contexts/enumerable.rb
|
179
|
-
- lib/mongoid/contexts/ids.rb
|
180
183
|
- lib/mongoid/contexts/mongo.rb
|
181
184
|
- lib/mongoid/contexts/paging.rb
|
182
185
|
- lib/mongoid/contexts.rb
|
183
186
|
- lib/mongoid/copyable.rb
|
184
187
|
- lib/mongoid/criteria.rb
|
188
|
+
- lib/mongoid/criterion/builder.rb
|
185
189
|
- lib/mongoid/criterion/complex.rb
|
186
190
|
- lib/mongoid/criterion/creational.rb
|
187
191
|
- lib/mongoid/criterion/exclusion.rb
|
@@ -199,6 +203,7 @@ files:
|
|
199
203
|
- lib/mongoid/errors/invalid_field.rb
|
200
204
|
- lib/mongoid/errors/invalid_options.rb
|
201
205
|
- lib/mongoid/errors/invalid_type.rb
|
206
|
+
- lib/mongoid/errors/mixed_relations.rb
|
202
207
|
- lib/mongoid/errors/mongoid_error.rb
|
203
208
|
- lib/mongoid/errors/too_many_nested_attribute_records.rb
|
204
209
|
- lib/mongoid/errors/unsaved_document.rb
|
@@ -260,15 +265,19 @@ files:
|
|
260
265
|
- lib/mongoid/matchers/size.rb
|
261
266
|
- lib/mongoid/matchers/strategies.rb
|
262
267
|
- lib/mongoid/matchers.rb
|
263
|
-
- lib/mongoid/modifiers/command.rb
|
264
|
-
- lib/mongoid/modifiers/inc.rb
|
265
|
-
- lib/mongoid/modifiers.rb
|
266
268
|
- lib/mongoid/multi_database.rb
|
267
269
|
- lib/mongoid/multi_parameter_attributes.rb
|
268
270
|
- lib/mongoid/named_scope.rb
|
269
271
|
- lib/mongoid/nested_attributes.rb
|
272
|
+
- lib/mongoid/observer.rb
|
270
273
|
- lib/mongoid/paranoia.rb
|
271
274
|
- lib/mongoid/paths.rb
|
275
|
+
- lib/mongoid/persistence/atomic/add_to_set.rb
|
276
|
+
- lib/mongoid/persistence/atomic/inc.rb
|
277
|
+
- lib/mongoid/persistence/atomic/operation.rb
|
278
|
+
- lib/mongoid/persistence/atomic/pull_all.rb
|
279
|
+
- lib/mongoid/persistence/atomic/push.rb
|
280
|
+
- lib/mongoid/persistence/atomic.rb
|
272
281
|
- lib/mongoid/persistence/command.rb
|
273
282
|
- lib/mongoid/persistence/insert.rb
|
274
283
|
- lib/mongoid/persistence/insert_embedded.rb
|
@@ -309,6 +318,12 @@ files:
|
|
309
318
|
- lib/mongoid/relations/cascading.rb
|
310
319
|
- lib/mongoid/relations/constraint.rb
|
311
320
|
- lib/mongoid/relations/cyclic.rb
|
321
|
+
- lib/mongoid/relations/embedded/atomic/operation.rb
|
322
|
+
- lib/mongoid/relations/embedded/atomic/pull.rb
|
323
|
+
- lib/mongoid/relations/embedded/atomic/push_all.rb
|
324
|
+
- lib/mongoid/relations/embedded/atomic/set.rb
|
325
|
+
- lib/mongoid/relations/embedded/atomic/unset.rb
|
326
|
+
- lib/mongoid/relations/embedded/atomic.rb
|
312
327
|
- lib/mongoid/relations/embedded/in.rb
|
313
328
|
- lib/mongoid/relations/embedded/many.rb
|
314
329
|
- lib/mongoid/relations/embedded/one.rb
|
@@ -329,9 +344,13 @@ files:
|
|
329
344
|
- lib/mongoid/safety.rb
|
330
345
|
- lib/mongoid/scope.rb
|
331
346
|
- lib/mongoid/serialization.rb
|
347
|
+
- lib/mongoid/sharding.rb
|
332
348
|
- lib/mongoid/state.rb
|
349
|
+
- lib/mongoid/timestamps/created.rb
|
350
|
+
- lib/mongoid/timestamps/updated.rb
|
333
351
|
- lib/mongoid/timestamps.rb
|
334
352
|
- lib/mongoid/validations/associated.rb
|
353
|
+
- lib/mongoid/validations/referenced.rb
|
335
354
|
- lib/mongoid/validations/uniqueness.rb
|
336
355
|
- lib/mongoid/validations.rb
|
337
356
|
- lib/mongoid/version.rb
|
@@ -341,6 +360,8 @@ files:
|
|
341
360
|
- lib/rails/generators/mongoid/config/templates/mongoid.yml
|
342
361
|
- lib/rails/generators/mongoid/model/model_generator.rb
|
343
362
|
- lib/rails/generators/mongoid/model/templates/model.rb
|
363
|
+
- lib/rails/generators/mongoid/observer/observer_generator.rb
|
364
|
+
- lib/rails/generators/mongoid/observer/templates/observer.rb
|
344
365
|
- lib/rails/generators/mongoid_generator.rb
|
345
366
|
- lib/rails/mongoid.rb
|
346
367
|
- LICENSE
|
@@ -360,7 +381,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
360
381
|
requirements:
|
361
382
|
- - ">="
|
362
383
|
- !ruby/object:Gem::Version
|
363
|
-
hash:
|
384
|
+
hash: 2466233120358762618
|
364
385
|
segments:
|
365
386
|
- 0
|
366
387
|
version: "0"
|