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.
Files changed (90) hide show
  1. data/lib/config/locales/en.yml +3 -0
  2. data/lib/config/locales/id.yml +46 -0
  3. data/lib/config/locales/ja.yml +40 -0
  4. data/lib/config/locales/vi.yml +45 -0
  5. data/lib/mongoid.rb +5 -3
  6. data/lib/mongoid/attributes.rb +24 -63
  7. data/lib/mongoid/attributes/processing.rb +5 -2
  8. data/lib/mongoid/callbacks.rb +10 -0
  9. data/lib/mongoid/collection.rb +24 -0
  10. data/lib/mongoid/collections/master.rb +14 -6
  11. data/lib/mongoid/collections/operations.rb +1 -1
  12. data/lib/mongoid/collections/retry.rb +39 -0
  13. data/lib/mongoid/collections/slaves.rb +26 -10
  14. data/lib/mongoid/components.rb +4 -4
  15. data/lib/mongoid/config.rb +6 -3
  16. data/lib/mongoid/contexts.rb +0 -1
  17. data/lib/mongoid/contexts/enumerable.rb +19 -7
  18. data/lib/mongoid/contexts/mongo.rb +9 -5
  19. data/lib/mongoid/copyable.rb +10 -8
  20. data/lib/mongoid/criteria.rb +83 -61
  21. data/lib/mongoid/criterion/builder.rb +34 -0
  22. data/lib/mongoid/criterion/creational.rb +2 -2
  23. data/lib/mongoid/criterion/exclusion.rb +58 -32
  24. data/lib/mongoid/criterion/inclusion.rb +49 -10
  25. data/lib/mongoid/criterion/optional.rb +1 -1
  26. data/lib/mongoid/criterion/selector.rb +80 -11
  27. data/lib/mongoid/cursor.rb +6 -1
  28. data/lib/mongoid/default_scope.rb +27 -19
  29. data/lib/mongoid/document.rb +26 -1
  30. data/lib/mongoid/errors.rb +1 -0
  31. data/lib/mongoid/errors/mixed_relations.rb +37 -0
  32. data/lib/mongoid/extensions/object_id/conversions.rb +7 -4
  33. data/lib/mongoid/factory.rb +1 -1
  34. data/lib/mongoid/field.rb +47 -30
  35. data/lib/mongoid/fields.rb +9 -2
  36. data/lib/mongoid/finders.rb +15 -49
  37. data/lib/mongoid/identity.rb +6 -4
  38. data/lib/mongoid/keys.rb +85 -31
  39. data/lib/mongoid/multi_parameter_attributes.rb +2 -2
  40. data/lib/mongoid/named_scope.rb +129 -28
  41. data/lib/mongoid/observer.rb +36 -0
  42. data/lib/mongoid/paranoia.rb +3 -3
  43. data/lib/mongoid/paths.rb +1 -1
  44. data/lib/mongoid/persistence.rb +2 -0
  45. data/lib/mongoid/persistence/atomic.rb +88 -0
  46. data/lib/mongoid/persistence/atomic/add_to_set.rb +30 -0
  47. data/lib/mongoid/persistence/atomic/inc.rb +28 -0
  48. data/lib/mongoid/persistence/atomic/operation.rb +44 -0
  49. data/lib/mongoid/persistence/atomic/pull_all.rb +33 -0
  50. data/lib/mongoid/persistence/atomic/push.rb +28 -0
  51. data/lib/mongoid/railtie.rb +13 -1
  52. data/lib/mongoid/relations.rb +1 -0
  53. data/lib/mongoid/relations/accessors.rb +20 -2
  54. data/lib/mongoid/relations/builders/embedded/one.rb +1 -0
  55. data/lib/mongoid/relations/builders/nested_attributes/many.rb +17 -6
  56. data/lib/mongoid/relations/builders/referenced/many.rb +2 -1
  57. data/lib/mongoid/relations/builders/referenced/one.rb +1 -0
  58. data/lib/mongoid/relations/embedded/atomic.rb +86 -0
  59. data/lib/mongoid/relations/embedded/atomic/operation.rb +63 -0
  60. data/lib/mongoid/relations/embedded/atomic/pull.rb +65 -0
  61. data/lib/mongoid/relations/embedded/atomic/push_all.rb +59 -0
  62. data/lib/mongoid/relations/embedded/atomic/set.rb +61 -0
  63. data/lib/mongoid/relations/embedded/atomic/unset.rb +41 -0
  64. data/lib/mongoid/relations/embedded/many.rb +57 -25
  65. data/lib/mongoid/relations/macros.rb +6 -4
  66. data/lib/mongoid/relations/many.rb +51 -10
  67. data/lib/mongoid/relations/metadata.rb +4 -2
  68. data/lib/mongoid/relations/proxy.rb +39 -24
  69. data/lib/mongoid/relations/referenced/many.rb +47 -26
  70. data/lib/mongoid/relations/referenced/many_to_many.rb +47 -14
  71. data/lib/mongoid/relations/referenced/one.rb +14 -0
  72. data/lib/mongoid/sharding.rb +51 -0
  73. data/lib/mongoid/state.rb +3 -2
  74. data/lib/mongoid/timestamps.rb +5 -29
  75. data/lib/mongoid/timestamps/created.rb +31 -0
  76. data/lib/mongoid/timestamps/updated.rb +33 -0
  77. data/lib/mongoid/validations.rb +10 -3
  78. data/lib/mongoid/validations/referenced.rb +58 -0
  79. data/lib/mongoid/version.rb +1 -1
  80. data/lib/mongoid/versioning.rb +67 -5
  81. data/lib/rails/generators/mongoid/model/templates/model.rb +2 -0
  82. data/lib/rails/generators/mongoid/observer/observer_generator.rb +17 -0
  83. data/lib/rails/generators/mongoid/observer/templates/observer.rb +4 -0
  84. data/lib/rails/generators/mongoid_generator.rb +10 -1
  85. data/lib/rails/mongoid.rb +1 -0
  86. metadata +29 -8
  87. data/lib/mongoid/contexts/ids.rb +0 -25
  88. data/lib/mongoid/modifiers.rb +0 -24
  89. data/lib/mongoid/modifiers/command.rb +0 -18
  90. data/lib/mongoid/modifiers/inc.rb +0 -24
@@ -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
@@ -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
- included do
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
@@ -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.validate_relation(metadata)
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 validate_relation(metadata)
113
- validates_associated(metadata.name) if metadata.validate?
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
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Mongoid #:nodoc
3
- VERSION = "2.0.0.rc.7"
3
+ VERSION = "2.0.0.rc.8"
4
4
  end
@@ -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 => :changed?
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
- last_version = self.class.first(:conditions => { :_id => id, :version => version })
27
- if last_version
28
- versions.target << last_version.clone
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
@@ -0,0 +1,4 @@
1
+ <% module_namespacing do -%>
2
+ class <%= class_name %>Observer < Mongoid::Observer
3
+ end
4
+ <% end -%>
@@ -8,7 +8,16 @@ module Mongoid #:nodoc:
8
8
 
9
9
  def self.source_root
10
10
  @_mongoid_source_root ||=
11
- File.expand_path("../#{base_name}/#{generator_name}/templates", __FILE__)
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
 
@@ -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
- - 7
11
- version: 2.0.0.rc.7
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-01-29 00:00:00 +01:00
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: -2421077816225192598
384
+ hash: 2466233120358762618
364
385
  segments:
365
386
  - 0
366
387
  version: "0"