mongoid 3.1.5 → 8.0.2
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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +636 -33
- data/LICENSE +2 -1
- data/README.md +32 -24
- data/Rakefile +75 -5
- data/lib/config/locales/en.yml +301 -132
- data/lib/mongoid/association/accessors.rb +431 -0
- data/lib/mongoid/association/bindable.rb +227 -0
- data/lib/mongoid/association/builders.rb +86 -0
- data/lib/mongoid/association/constrainable.rb +42 -0
- data/lib/mongoid/association/depending.rb +128 -0
- data/lib/mongoid/association/eager_loadable.rb +57 -0
- data/lib/mongoid/association/embedded/batchable.rb +398 -0
- data/lib/mongoid/association/embedded/cyclic.rb +102 -0
- data/lib/mongoid/association/embedded/embedded_in/binding.rb +74 -0
- data/lib/mongoid/association/embedded/embedded_in/buildable.rb +38 -0
- data/lib/mongoid/association/embedded/embedded_in/proxy.rb +111 -0
- data/lib/mongoid/association/embedded/embedded_in.rb +135 -0
- data/lib/mongoid/association/embedded/embeds_many/binding.rb +42 -0
- data/lib/mongoid/association/embedded/embeds_many/buildable.rb +45 -0
- data/lib/mongoid/association/embedded/embeds_many/proxy.rb +571 -0
- data/lib/mongoid/association/embedded/embeds_many.rb +183 -0
- data/lib/mongoid/association/embedded/embeds_one/binding.rb +43 -0
- data/lib/mongoid/association/embedded/embeds_one/buildable.rb +53 -0
- data/lib/mongoid/association/embedded/embeds_one/proxy.rb +164 -0
- data/lib/mongoid/association/embedded/embeds_one.rb +150 -0
- data/lib/mongoid/association/embedded.rb +6 -0
- data/lib/mongoid/association/macros.rb +228 -0
- data/lib/mongoid/association/many.rb +202 -0
- data/lib/mongoid/association/marshalable.rb +31 -0
- data/lib/mongoid/association/nested/many.rb +192 -0
- data/lib/mongoid/association/nested/nested_buildable.rb +66 -0
- data/lib/mongoid/association/nested/one.rb +116 -0
- data/lib/mongoid/association/nested.rb +15 -0
- data/lib/mongoid/association/one.rb +53 -0
- data/lib/mongoid/association/options.rb +122 -0
- data/lib/mongoid/association/proxy.rb +200 -0
- data/lib/mongoid/association/referenced/auto_save.rb +74 -0
- data/lib/mongoid/association/referenced/belongs_to/binding.rb +83 -0
- data/lib/mongoid/association/referenced/belongs_to/buildable.rb +48 -0
- data/lib/mongoid/association/referenced/belongs_to/eager.rb +73 -0
- data/lib/mongoid/association/referenced/belongs_to/proxy.rb +124 -0
- data/lib/mongoid/association/referenced/belongs_to.rb +226 -0
- data/lib/mongoid/association/referenced/counter_cache.rb +152 -0
- data/lib/mongoid/association/referenced/eager.rb +163 -0
- data/lib/mongoid/association/referenced/has_and_belongs_to_many/binding.rb +72 -0
- data/lib/mongoid/association/referenced/has_and_belongs_to_many/buildable.rb +40 -0
- data/lib/mongoid/association/referenced/has_and_belongs_to_many/eager.rb +53 -0
- data/lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb +345 -0
- data/lib/mongoid/association/referenced/has_and_belongs_to_many.rb +273 -0
- data/lib/mongoid/association/referenced/has_many/binding.rb +36 -0
- data/lib/mongoid/association/referenced/has_many/buildable.rb +38 -0
- data/lib/mongoid/association/referenced/has_many/eager.rb +44 -0
- data/lib/mongoid/association/referenced/has_many/enumerable.rb +494 -0
- data/lib/mongoid/association/referenced/has_many/proxy.rb +551 -0
- data/lib/mongoid/association/referenced/has_many.rb +251 -0
- data/lib/mongoid/association/referenced/has_one/binding.rb +42 -0
- data/lib/mongoid/association/referenced/has_one/buildable.rb +74 -0
- data/lib/mongoid/association/referenced/has_one/eager.rb +36 -0
- data/lib/mongoid/association/referenced/has_one/nested_builder.rb +113 -0
- data/lib/mongoid/association/referenced/has_one/proxy.rb +108 -0
- data/lib/mongoid/association/referenced/has_one.rb +184 -0
- data/lib/mongoid/association/referenced/syncable.rb +155 -0
- data/lib/mongoid/association/referenced.rb +9 -0
- data/lib/mongoid/association/reflections.rb +69 -0
- data/lib/mongoid/association/relatable.rb +489 -0
- data/lib/mongoid/association.rb +135 -0
- data/lib/mongoid/atomic/modifiers.rb +41 -61
- data/lib/mongoid/atomic/paths/embedded/many.rb +24 -8
- data/lib/mongoid/atomic/paths/embedded/one.rb +5 -8
- data/lib/mongoid/atomic/paths/embedded.rb +3 -34
- data/lib/mongoid/atomic/paths/root.rb +4 -20
- data/lib/mongoid/atomic/paths.rb +2 -1
- data/lib/mongoid/atomic.rb +52 -69
- data/lib/mongoid/attributes/dynamic.rb +141 -0
- data/lib/mongoid/attributes/nested.rb +93 -0
- data/lib/mongoid/attributes/processing.rb +35 -97
- data/lib/mongoid/attributes/projector.rb +119 -0
- data/lib/mongoid/attributes/readonly.rb +27 -10
- data/lib/mongoid/attributes.rb +159 -181
- data/lib/mongoid/cacheable.rb +33 -0
- data/lib/mongoid/changeable.rb +420 -0
- data/lib/mongoid/clients/factory.rb +105 -0
- data/lib/mongoid/clients/options.rb +111 -0
- data/lib/mongoid/clients/sessions.rb +113 -0
- data/lib/mongoid/clients/storage_options.rb +79 -0
- data/lib/mongoid/clients/validators/storage.rb +58 -0
- data/lib/mongoid/clients/validators.rb +3 -0
- data/lib/mongoid/clients.rb +79 -0
- data/lib/mongoid/composable.rb +128 -0
- data/lib/mongoid/config/environment.rb +51 -13
- data/lib/mongoid/config/options.rb +30 -18
- data/lib/mongoid/config/validators/client.rb +128 -0
- data/lib/mongoid/config/validators/option.rb +3 -4
- data/lib/mongoid/config/validators.rb +3 -2
- data/lib/mongoid/config.rb +170 -89
- data/lib/mongoid/contextual/aggregable/memory.rb +40 -27
- data/lib/mongoid/contextual/aggregable/mongo.rb +33 -36
- data/lib/mongoid/contextual/aggregable/none.rb +65 -0
- data/lib/mongoid/contextual/aggregable.rb +17 -0
- data/lib/mongoid/contextual/atomic.rb +80 -79
- data/lib/mongoid/contextual/command.rb +8 -11
- data/lib/mongoid/contextual/geo_near.rb +42 -44
- data/lib/mongoid/contextual/map_reduce.rb +33 -127
- data/lib/mongoid/contextual/memory.rb +226 -88
- data/lib/mongoid/contextual/mongo.rb +466 -293
- data/lib/mongoid/contextual/none.rb +193 -0
- data/lib/mongoid/contextual/queryable.rb +3 -4
- data/lib/mongoid/contextual.rb +11 -11
- data/lib/mongoid/copyable.rb +68 -20
- data/lib/mongoid/criteria/findable.rb +143 -0
- data/lib/mongoid/criteria/includable.rb +92 -0
- data/lib/mongoid/criteria/inspectable.rb +24 -0
- data/lib/mongoid/criteria/marshalable.rb +55 -0
- data/lib/mongoid/criteria/modifiable.rb +235 -0
- data/lib/mongoid/criteria/options.rb +24 -0
- data/lib/mongoid/criteria/permission.rb +71 -0
- data/lib/mongoid/criteria/queryable/aggregable.rb +109 -0
- data/lib/mongoid/criteria/queryable/expandable.rb +68 -0
- data/lib/mongoid/criteria/queryable/extensions/array.rb +151 -0
- data/lib/mongoid/criteria/queryable/extensions/big_decimal.rb +57 -0
- data/lib/mongoid/criteria/queryable/extensions/boolean.rb +33 -0
- data/lib/mongoid/criteria/queryable/extensions/date.rb +63 -0
- data/lib/mongoid/criteria/queryable/extensions/date_time.rb +52 -0
- data/lib/mongoid/criteria/queryable/extensions/hash.rb +163 -0
- data/lib/mongoid/criteria/queryable/extensions/nil_class.rb +75 -0
- data/lib/mongoid/criteria/queryable/extensions/numeric.rb +81 -0
- data/lib/mongoid/criteria/queryable/extensions/object.rb +182 -0
- data/lib/mongoid/criteria/queryable/extensions/range.rb +102 -0
- data/lib/mongoid/criteria/queryable/extensions/regexp.rb +72 -0
- data/lib/mongoid/criteria/queryable/extensions/set.rb +33 -0
- data/lib/mongoid/criteria/queryable/extensions/string.rb +122 -0
- data/lib/mongoid/criteria/queryable/extensions/symbol.rb +74 -0
- data/lib/mongoid/criteria/queryable/extensions/time.rb +60 -0
- data/lib/mongoid/criteria/queryable/extensions/time_with_zone.rb +66 -0
- data/lib/mongoid/criteria/queryable/extensions.rb +25 -0
- data/lib/mongoid/criteria/queryable/key.rb +177 -0
- data/lib/mongoid/criteria/queryable/macroable.rb +26 -0
- data/lib/mongoid/criteria/queryable/mergeable.rb +434 -0
- data/lib/mongoid/criteria/queryable/optional.rb +380 -0
- data/lib/mongoid/criteria/queryable/options.rb +136 -0
- data/lib/mongoid/criteria/queryable/pipeline.rb +106 -0
- data/lib/mongoid/criteria/queryable/selectable.rb +937 -0
- data/lib/mongoid/criteria/queryable/selector.rb +287 -0
- data/lib/mongoid/criteria/queryable/smash.rb +128 -0
- data/lib/mongoid/criteria/queryable/storable.rb +237 -0
- data/lib/mongoid/criteria/queryable.rb +90 -0
- data/lib/mongoid/criteria/scopable.rb +166 -0
- data/lib/mongoid/criteria.rb +177 -189
- data/lib/mongoid/deprecable.rb +36 -0
- data/lib/mongoid/deprecation.rb +25 -0
- data/lib/mongoid/document.rb +193 -139
- data/lib/mongoid/equality.rb +35 -18
- data/lib/mongoid/errors/ambiguous_relationship.rb +5 -6
- data/lib/mongoid/errors/callback.rb +2 -3
- data/lib/mongoid/errors/criteria_argument_required.rb +18 -0
- data/lib/mongoid/errors/delete_restriction.rb +10 -13
- data/lib/mongoid/errors/document_not_destroyed.rb +22 -0
- data/lib/mongoid/errors/document_not_found.rb +36 -21
- data/lib/mongoid/errors/empty_config_file.rb +25 -0
- data/lib/mongoid/errors/in_memory_collation_not_supported.rb +19 -0
- data/lib/mongoid/errors/invalid_collection.rb +2 -1
- data/lib/mongoid/errors/invalid_config_file.rb +25 -0
- data/lib/mongoid/errors/invalid_config_option.rb +3 -4
- data/lib/mongoid/errors/invalid_dependent_strategy.rb +31 -0
- data/lib/mongoid/errors/invalid_discriminator_key_target.rb +24 -0
- data/lib/mongoid/errors/invalid_dot_dollar_assignment.rb +23 -0
- data/lib/mongoid/errors/invalid_elem_match_operator.rb +32 -0
- data/lib/mongoid/errors/invalid_estimated_count_criteria.rb +25 -0
- data/lib/mongoid/errors/invalid_expression_operator.rb +27 -0
- data/lib/mongoid/errors/invalid_field.rb +10 -9
- data/lib/mongoid/errors/invalid_field_operator.rb +32 -0
- data/lib/mongoid/errors/invalid_field_option.rb +2 -3
- data/lib/mongoid/errors/invalid_field_type.rb +26 -0
- data/lib/mongoid/errors/invalid_find.rb +2 -3
- data/lib/mongoid/errors/invalid_includes.rb +2 -3
- data/lib/mongoid/errors/invalid_index.rb +2 -3
- data/lib/mongoid/errors/invalid_options.rb +4 -5
- data/lib/mongoid/errors/invalid_path.rb +2 -3
- data/lib/mongoid/errors/invalid_persistence_option.rb +26 -0
- data/lib/mongoid/errors/invalid_query.rb +40 -0
- data/lib/mongoid/errors/invalid_relation.rb +61 -0
- data/lib/mongoid/errors/invalid_relation_option.rb +28 -0
- data/lib/mongoid/errors/invalid_scope.rb +2 -3
- data/lib/mongoid/errors/invalid_session_use.rb +21 -0
- data/lib/mongoid/errors/invalid_set_polymorphic_relation.rb +6 -5
- data/lib/mongoid/errors/invalid_storage_options.rb +4 -5
- data/lib/mongoid/errors/invalid_storage_parent.rb +25 -0
- data/lib/mongoid/errors/invalid_time.rb +2 -3
- data/lib/mongoid/errors/inverse_not_found.rb +4 -5
- data/lib/mongoid/errors/mixed_client_configuration.rb +27 -0
- data/lib/mongoid/errors/mixed_relations.rb +2 -3
- data/lib/mongoid/errors/mongoid_error.rb +22 -23
- data/lib/mongoid/errors/nested_attributes_metadata_not_found.rb +3 -4
- data/lib/mongoid/errors/no_client_config.rb +21 -0
- data/lib/mongoid/errors/no_client_database.rb +26 -0
- data/lib/mongoid/errors/no_client_hosts.rb +26 -0
- data/lib/mongoid/errors/no_clients_config.rb +19 -0
- data/lib/mongoid/errors/no_default_client.rb +22 -0
- data/lib/mongoid/errors/no_environment.rb +2 -3
- data/lib/mongoid/errors/no_map_reduce_output.rb +2 -3
- data/lib/mongoid/errors/no_metadata.rb +2 -3
- data/lib/mongoid/errors/no_parent.rb +2 -3
- data/lib/mongoid/errors/readonly_attribute.rb +3 -4
- data/lib/mongoid/errors/readonly_document.rb +21 -0
- data/lib/mongoid/errors/scope_overwrite.rb +2 -1
- data/lib/mongoid/errors/too_many_nested_attribute_records.rb +3 -1
- data/lib/mongoid/errors/unknown_attribute.rb +3 -4
- data/lib/mongoid/errors/unknown_model.rb +24 -0
- data/lib/mongoid/errors/unsaved_document.rb +3 -2
- data/lib/mongoid/errors/unsupported_javascript.rb +2 -3
- data/lib/mongoid/errors/validations.rb +2 -1
- data/lib/mongoid/errors.rb +30 -9
- data/lib/mongoid/evolvable.rb +4 -5
- data/lib/mongoid/extensions/array.rb +45 -52
- data/lib/mongoid/extensions/big_decimal.rb +41 -22
- data/lib/mongoid/extensions/binary.rb +42 -0
- data/lib/mongoid/extensions/boolean.rb +19 -17
- data/lib/mongoid/extensions/date.rb +33 -23
- data/lib/mongoid/extensions/date_time.rb +5 -13
- data/lib/mongoid/extensions/decimal128.rb +36 -0
- data/lib/mongoid/extensions/false_class.rb +5 -8
- data/lib/mongoid/extensions/float.rb +11 -16
- data/lib/mongoid/extensions/hash.rb +88 -49
- data/lib/mongoid/extensions/integer.rb +10 -18
- data/lib/mongoid/extensions/module.rb +3 -4
- data/lib/mongoid/extensions/nil_class.rb +2 -5
- data/lib/mongoid/extensions/object.rb +38 -62
- data/lib/mongoid/extensions/object_id.rb +7 -12
- data/lib/mongoid/extensions/range.rb +46 -17
- data/lib/mongoid/extensions/regexp.rb +15 -8
- data/lib/mongoid/extensions/set.rb +17 -15
- data/lib/mongoid/extensions/string.rb +40 -80
- data/lib/mongoid/extensions/symbol.rb +7 -23
- data/lib/mongoid/extensions/time.rb +42 -25
- data/lib/mongoid/extensions/time_with_zone.rb +27 -10
- data/lib/mongoid/extensions/true_class.rb +5 -8
- data/lib/mongoid/extensions.rb +31 -13
- data/lib/mongoid/factory.rb +99 -11
- data/lib/mongoid/fields/foreign_key.rb +26 -34
- data/lib/mongoid/fields/localized.rb +24 -13
- data/lib/mongoid/fields/standard.rb +19 -73
- data/lib/mongoid/fields/validators/macro.rb +56 -15
- data/lib/mongoid/fields/validators.rb +2 -1
- data/lib/mongoid/fields.rb +342 -87
- data/lib/mongoid/findable.rb +219 -0
- data/lib/mongoid/indexable/specification.rb +103 -0
- data/lib/mongoid/indexable/validators/options.rb +110 -0
- data/lib/mongoid/indexable.rb +148 -0
- data/lib/mongoid/inspectable.rb +52 -0
- data/lib/mongoid/interceptable.rb +312 -0
- data/lib/mongoid/loggable.rb +15 -18
- data/lib/mongoid/matchable.rb +23 -0
- data/lib/mongoid/matcher/all.rb +22 -0
- data/lib/mongoid/matcher/and.rb +21 -0
- data/lib/mongoid/matcher/bits.rb +41 -0
- data/lib/mongoid/matcher/bits_all_clear.rb +20 -0
- data/lib/mongoid/matcher/bits_all_set.rb +20 -0
- data/lib/mongoid/matcher/bits_any_clear.rb +20 -0
- data/lib/mongoid/matcher/bits_any_set.rb +20 -0
- data/lib/mongoid/matcher/elem_match.rb +36 -0
- data/lib/mongoid/matcher/elem_match_expression.rb +20 -0
- data/lib/mongoid/matcher/eq.rb +11 -0
- data/lib/mongoid/matcher/eq_impl.rb +67 -0
- data/lib/mongoid/matcher/eq_impl_with_regexp.rb +26 -0
- data/lib/mongoid/matcher/exists.rb +15 -0
- data/lib/mongoid/matcher/expression.rb +35 -0
- data/lib/mongoid/matcher/expression_operator.rb +19 -0
- data/lib/mongoid/matcher/field_expression.rb +62 -0
- data/lib/mongoid/matcher/field_operator.rb +54 -0
- data/lib/mongoid/matcher/gt.rb +17 -0
- data/lib/mongoid/matcher/gte.rb +17 -0
- data/lib/mongoid/matcher/in.rb +25 -0
- data/lib/mongoid/matcher/lt.rb +17 -0
- data/lib/mongoid/matcher/lte.rb +17 -0
- data/lib/mongoid/matcher/mod.rb +17 -0
- data/lib/mongoid/matcher/ne.rb +16 -0
- data/lib/mongoid/matcher/nin.rb +11 -0
- data/lib/mongoid/matcher/nor.rb +25 -0
- data/lib/mongoid/matcher/not.rb +29 -0
- data/lib/mongoid/matcher/or.rb +21 -0
- data/lib/mongoid/matcher/regex.rb +41 -0
- data/lib/mongoid/matcher/size.rb +26 -0
- data/lib/mongoid/matcher/type.rb +99 -0
- data/lib/mongoid/matcher.rb +115 -0
- data/lib/mongoid/persistable/creatable.rb +181 -0
- data/lib/mongoid/persistable/deletable.rb +132 -0
- data/lib/mongoid/persistable/destroyable.rb +57 -0
- data/lib/mongoid/persistable/incrementable.rb +35 -0
- data/lib/mongoid/persistable/logical.rb +36 -0
- data/lib/mongoid/persistable/poppable.rb +36 -0
- data/lib/mongoid/persistable/pullable.rb +50 -0
- data/lib/mongoid/persistable/pushable.rb +66 -0
- data/lib/mongoid/persistable/renamable.rb +37 -0
- data/lib/mongoid/persistable/savable.rb +47 -0
- data/lib/mongoid/persistable/settable.rb +93 -0
- data/lib/mongoid/persistable/unsettable.rb +36 -0
- data/lib/mongoid/persistable/updatable.rb +165 -0
- data/lib/mongoid/persistable/upsertable.rb +51 -0
- data/lib/mongoid/persistable.rb +305 -0
- data/lib/mongoid/persistence_context.rb +239 -0
- data/lib/mongoid/positional.rb +72 -0
- data/lib/mongoid/query_cache.rb +64 -0
- data/lib/mongoid/railtie.rb +35 -78
- data/lib/mongoid/railties/controller_runtime.rb +88 -0
- data/lib/mongoid/railties/database.rake +18 -25
- data/lib/mongoid/reloadable.rb +94 -0
- data/lib/mongoid/scopable.rb +324 -0
- data/lib/mongoid/selectable.rb +49 -0
- data/lib/mongoid/serializable.rb +170 -0
- data/lib/mongoid/shardable.rb +130 -0
- data/lib/mongoid/stateful.rb +134 -0
- data/lib/mongoid/stringified_symbol.rb +52 -0
- data/lib/mongoid/tasks/database.rake +38 -0
- data/lib/mongoid/tasks/database.rb +194 -0
- data/lib/mongoid/threaded/lifecycle.rb +28 -70
- data/lib/mongoid/threaded.rb +142 -219
- data/lib/mongoid/timestamps/created/short.rb +2 -1
- data/lib/mongoid/timestamps/created.rb +9 -5
- data/lib/mongoid/timestamps/short.rb +2 -1
- data/lib/mongoid/timestamps/timeless.rb +52 -16
- data/lib/mongoid/timestamps/updated/short.rb +4 -3
- data/lib/mongoid/timestamps/updated.rb +14 -9
- data/lib/mongoid/timestamps.rb +4 -3
- data/lib/mongoid/touchable.rb +131 -0
- data/lib/mongoid/traversable.rb +337 -0
- data/lib/mongoid/validatable/associated.rb +47 -0
- data/lib/mongoid/validatable/format.rb +21 -0
- data/lib/mongoid/validatable/length.rb +21 -0
- data/lib/mongoid/validatable/localizable.rb +29 -0
- data/lib/mongoid/validatable/macros.rb +89 -0
- data/lib/mongoid/validatable/presence.rb +81 -0
- data/lib/mongoid/validatable/queryable.rb +29 -0
- data/lib/mongoid/validatable/uniqueness.rb +304 -0
- data/lib/mongoid/validatable.rb +160 -0
- data/lib/mongoid/version.rb +3 -2
- data/lib/mongoid/warnings.rb +28 -0
- data/lib/mongoid.rb +68 -109
- data/lib/rails/generators/mongoid/config/config_generator.rb +10 -2
- data/lib/rails/generators/mongoid/config/templates/mongoid.yml +150 -45
- data/lib/rails/generators/mongoid/model/model_generator.rb +3 -3
- data/lib/rails/generators/mongoid/model/templates/model.rb.tt +1 -4
- data/lib/rails/generators/mongoid_generator.rb +5 -41
- data/lib/rails/mongoid.rb +6 -129
- data/spec/README.md +33 -0
- data/spec/config/mongoid.yml +56 -25
- data/spec/config/mongoid_with_schema_map_uuid.yml +27 -0
- data/spec/integration/app_spec.rb +345 -0
- data/spec/integration/associations/belongs_to_spec.rb +33 -0
- data/spec/integration/associations/embedded_dirty_spec.rb +57 -0
- data/spec/integration/associations/embedded_spec.rb +283 -0
- data/spec/integration/associations/embeds_many_spec.rb +219 -0
- data/spec/integration/associations/embeds_one_spec.rb +41 -0
- data/spec/integration/associations/foreign_key_spec.rb +107 -0
- data/spec/integration/associations/foreign_key_spec_models.rb +64 -0
- data/spec/integration/associations/has_and_belongs_to_many_spec.rb +21 -0
- data/spec/integration/associations/has_many_spec.rb +128 -0
- data/spec/integration/associations/has_one_spec.rb +272 -0
- data/spec/integration/associations/nested_attributes_assignment_spec.rb +115 -0
- data/spec/integration/associations/reverse_population_spec.rb +34 -0
- data/spec/integration/associations/reverse_population_spec_models.rb +36 -0
- data/spec/integration/associations/scope_option_spec.rb +101 -0
- data/spec/integration/atomic/modifiers_spec.rb +116 -0
- data/spec/integration/bson_regexp_raw_spec.rb +19 -0
- data/spec/integration/callbacks_models.rb +155 -0
- data/spec/integration/callbacks_spec.rb +450 -0
- data/spec/integration/contextual/empty_spec.rb +141 -0
- data/spec/integration/criteria/alias_query_spec.rb +161 -0
- data/spec/integration/criteria/date_field_spec.rb +40 -0
- data/spec/integration/criteria/default_scope_spec.rb +72 -0
- data/spec/integration/criteria/logical_spec.rb +124 -0
- data/spec/integration/criteria/range_spec.rb +359 -0
- data/spec/integration/criteria/time_with_zone_spec.rb +142 -0
- data/spec/integration/discriminator_key_spec.rb +392 -0
- data/spec/integration/discriminator_value_spec.rb +206 -0
- data/spec/integration/document_spec.rb +51 -0
- data/spec/integration/dots_and_dollars_spec.rb +277 -0
- data/spec/integration/i18n_fallbacks_spec.rb +89 -0
- data/spec/integration/matcher_examples_spec.rb +765 -0
- data/spec/integration/matcher_operator_data/all.yml +140 -0
- data/spec/integration/matcher_operator_data/and.yml +93 -0
- data/spec/integration/matcher_operator_data/bits_all_clear.yml +159 -0
- data/spec/integration/matcher_operator_data/bits_all_set.yml +159 -0
- data/spec/integration/matcher_operator_data/bits_any_clear.yml +159 -0
- data/spec/integration/matcher_operator_data/bits_any_set.yml +159 -0
- data/spec/integration/matcher_operator_data/comment.yml +22 -0
- data/spec/integration/matcher_operator_data/elem_match.yml +409 -0
- data/spec/integration/matcher_operator_data/elem_match_expr.yml +213 -0
- data/spec/integration/matcher_operator_data/eq.yml +191 -0
- data/spec/integration/matcher_operator_data/exists.yml +213 -0
- data/spec/integration/matcher_operator_data/generic_op.yml +17 -0
- data/spec/integration/matcher_operator_data/gt.yml +132 -0
- data/spec/integration/matcher_operator_data/gt_types.yml +63 -0
- data/spec/integration/matcher_operator_data/gte.yml +132 -0
- data/spec/integration/matcher_operator_data/gte_types.yml +15 -0
- data/spec/integration/matcher_operator_data/implicit.yml +331 -0
- data/spec/integration/matcher_operator_data/implicit_traversal.yml +112 -0
- data/spec/integration/matcher_operator_data/in.yml +210 -0
- data/spec/integration/matcher_operator_data/invalid_op.yml +59 -0
- data/spec/integration/matcher_operator_data/invalid_syntax.yml +39 -0
- data/spec/integration/matcher_operator_data/lt.yml +132 -0
- data/spec/integration/matcher_operator_data/lt_types.yml +15 -0
- data/spec/integration/matcher_operator_data/lte.yml +132 -0
- data/spec/integration/matcher_operator_data/lte_types.yml +15 -0
- data/spec/integration/matcher_operator_data/mod.yml +55 -0
- data/spec/integration/matcher_operator_data/multiple.yml +29 -0
- data/spec/integration/matcher_operator_data/ne.yml +150 -0
- data/spec/integration/matcher_operator_data/ne_types.yml +15 -0
- data/spec/integration/matcher_operator_data/nin.yml +114 -0
- data/spec/integration/matcher_operator_data/nor.yml +126 -0
- data/spec/integration/matcher_operator_data/not.yml +196 -0
- data/spec/integration/matcher_operator_data/or.yml +137 -0
- data/spec/integration/matcher_operator_data/regex.yml +174 -0
- data/spec/integration/matcher_operator_data/regex_options.yml +72 -0
- data/spec/integration/matcher_operator_data/size.yml +174 -0
- data/spec/integration/matcher_operator_data/type.yml +70 -0
- data/spec/integration/matcher_operator_data/type_array.yml +16 -0
- data/spec/integration/matcher_operator_data/type_binary.yml +18 -0
- data/spec/integration/matcher_operator_data/type_boolean.yml +39 -0
- data/spec/integration/matcher_operator_data/type_code.yml +26 -0
- data/spec/integration/matcher_operator_data/type_code_with_scope.yml +26 -0
- data/spec/integration/matcher_operator_data/type_date.yml +39 -0
- data/spec/integration/matcher_operator_data/type_db_pointer.yml +19 -0
- data/spec/integration/matcher_operator_data/type_decimal.yml +41 -0
- data/spec/integration/matcher_operator_data/type_double.yml +15 -0
- data/spec/integration/matcher_operator_data/type_int32.yml +33 -0
- data/spec/integration/matcher_operator_data/type_int64.yml +33 -0
- data/spec/integration/matcher_operator_data/type_max_key.yml +17 -0
- data/spec/integration/matcher_operator_data/type_min_key.yml +17 -0
- data/spec/integration/matcher_operator_data/type_null.yml +23 -0
- data/spec/integration/matcher_operator_data/type_object.yml +23 -0
- data/spec/integration/matcher_operator_data/type_object_id.yml +25 -0
- data/spec/integration/matcher_operator_data/type_regex.yml +44 -0
- data/spec/integration/matcher_operator_data/type_string.yml +15 -0
- data/spec/integration/matcher_operator_data/type_symbol.yml +32 -0
- data/spec/integration/matcher_operator_data/type_timestamp.yml +25 -0
- data/spec/integration/matcher_operator_data/type_undefined.yml +17 -0
- data/spec/integration/matcher_operator_spec.rb +122 -0
- data/spec/integration/matcher_spec.rb +283 -0
- data/spec/integration/persistence/range_field_spec.rb +350 -0
- data/spec/integration/server_query_spec.rb +141 -0
- data/spec/integration/shardable_spec.rb +148 -0
- data/spec/integration/stringified_symbol_field_spec.rb +203 -0
- data/spec/lite_spec_helper.rb +83 -0
- data/spec/mongoid/association/accessors_spec.rb +1067 -0
- data/spec/mongoid/association/auto_save_spec.rb +403 -0
- data/spec/mongoid/association/builders_spec.rb +255 -0
- data/spec/mongoid/association/constrainable_spec.rb +117 -0
- data/spec/mongoid/association/counter_cache_spec.rb +452 -0
- data/spec/mongoid/association/depending_spec.rb +959 -0
- data/spec/mongoid/association/eager_spec.rb +282 -0
- data/spec/mongoid/association/embedded/cyclic_spec.rb +180 -0
- data/spec/mongoid/association/embedded/dirty_spec.rb +67 -0
- data/spec/mongoid/association/embedded/embedded_in/binding_spec.rb +174 -0
- data/spec/mongoid/association/embedded/embedded_in/buildable_spec.rb +90 -0
- data/spec/mongoid/association/embedded/embedded_in/proxy_spec.rb +619 -0
- data/spec/mongoid/association/embedded/embedded_in_spec.rb +903 -0
- data/spec/mongoid/association/embedded/embeds_many/binding_spec.rb +56 -0
- data/spec/mongoid/association/embedded/embeds_many/buildable_spec.rb +218 -0
- data/spec/mongoid/association/embedded/embeds_many/proxy_spec.rb +4863 -0
- data/spec/mongoid/association/embedded/embeds_many_models.rb +226 -0
- data/spec/mongoid/association/embedded/embeds_many_query_spec.rb +63 -0
- data/spec/mongoid/association/embedded/embeds_many_spec.rb +932 -0
- data/spec/mongoid/association/embedded/embeds_one/binding_spec.rb +79 -0
- data/spec/mongoid/association/embedded/embeds_one/buildable_spec.rb +106 -0
- data/spec/mongoid/association/embedded/embeds_one/proxy_spec.rb +1025 -0
- data/spec/mongoid/association/embedded/embeds_one_dnl_models.rb +8 -0
- data/spec/mongoid/association/embedded/embeds_one_models.rb +73 -0
- data/spec/mongoid/association/embedded/embeds_one_query_spec.rb +28 -0
- data/spec/mongoid/association/embedded/embeds_one_spec.rb +984 -0
- data/spec/mongoid/association/macros_spec.rb +1116 -0
- data/spec/mongoid/association/nested/many_spec.rb +232 -0
- data/spec/mongoid/association/nested/one_spec.rb +253 -0
- data/spec/mongoid/association/options_spec.rb +1323 -0
- data/spec/mongoid/association/polymorphic_spec.rb +162 -0
- data/spec/mongoid/association/referenced/belongs_to/binding_spec.rb +244 -0
- data/spec/mongoid/association/referenced/belongs_to/buildable_spec.rb +292 -0
- data/spec/mongoid/association/referenced/belongs_to/eager_spec.rb +412 -0
- data/spec/mongoid/association/referenced/belongs_to/proxy_spec.rb +1388 -0
- data/spec/mongoid/association/referenced/belongs_to_models.rb +11 -0
- data/spec/mongoid/association/referenced/belongs_to_query_spec.rb +57 -0
- data/spec/mongoid/association/referenced/belongs_to_spec.rb +2046 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many/binding_spec.rb +180 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many/buildable_spec.rb +148 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many/eager_spec.rb +196 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many/proxy_persistence_spec.rb +76 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many/proxy_spec.rb +3836 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many_models.rb +92 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many_query_spec.rb +39 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many_spec.rb +1104 -0
- data/spec/mongoid/association/referenced/has_many/binding_spec.rb +155 -0
- data/spec/mongoid/association/referenced/has_many/buildable_spec.rb +251 -0
- data/spec/mongoid/association/referenced/has_many/eager_spec.rb +290 -0
- data/spec/mongoid/association/referenced/has_many/enumerable_spec.rb +2232 -0
- data/spec/mongoid/association/referenced/has_many/proxy_query_spec.rb +23 -0
- data/spec/mongoid/association/referenced/has_many/proxy_spec.rb +4161 -0
- data/spec/mongoid/association/referenced/has_many_models.rb +97 -0
- data/spec/mongoid/association/referenced/has_many_query_spec.rb +37 -0
- data/spec/mongoid/association/referenced/has_many_spec.rb +1273 -0
- data/spec/mongoid/association/referenced/has_one/binding_spec.rb +133 -0
- data/spec/mongoid/association/referenced/has_one/buildable_spec.rb +159 -0
- data/spec/mongoid/association/referenced/has_one/eager_spec.rb +193 -0
- data/spec/mongoid/association/referenced/has_one/proxy_spec.rb +1248 -0
- data/spec/mongoid/association/referenced/has_one_models.rb +113 -0
- data/spec/mongoid/association/referenced/has_one_query_spec.rb +37 -0
- data/spec/mongoid/association/referenced/has_one_spec.rb +1383 -0
- data/spec/mongoid/association/reflections_spec.rb +92 -0
- data/spec/mongoid/association/syncable_spec.rb +513 -0
- data/spec/mongoid/association_spec.rb +191 -0
- data/spec/mongoid/atomic/modifiers_spec.rb +88 -39
- data/spec/mongoid/atomic/paths/embedded/many_spec.rb +10 -49
- data/spec/mongoid/atomic/paths/embedded/one_spec.rb +9 -49
- data/spec/mongoid/atomic/paths/root_spec.rb +5 -61
- data/spec/mongoid/atomic/paths_spec.rb +115 -35
- data/spec/mongoid/atomic_spec.rb +89 -42
- data/spec/mongoid/attributes/dynamic_spec.rb +152 -0
- data/spec/mongoid/attributes/nested_spec.rb +5000 -0
- data/spec/mongoid/attributes/nested_spec_models.rb +48 -0
- data/spec/mongoid/attributes/projector_data/embedded.yml +105 -0
- data/spec/mongoid/attributes/projector_data/fields.yml +93 -0
- data/spec/mongoid/attributes/projector_spec.rb +40 -0
- data/spec/mongoid/attributes/readonly_spec.rb +166 -64
- data/spec/mongoid/attributes_spec.rb +1418 -409
- data/spec/mongoid/cacheable_spec.rb +114 -0
- data/spec/mongoid/changeable_spec.rb +1914 -0
- data/spec/mongoid/clients/factory_spec.rb +426 -0
- data/spec/mongoid/clients/options_spec.rb +521 -0
- data/spec/mongoid/clients/sessions_spec.rb +297 -0
- data/spec/mongoid/clients/transactions_spec.rb +415 -0
- data/spec/mongoid/clients_spec.rb +1084 -0
- data/spec/mongoid/composable_spec.rb +33 -0
- data/spec/mongoid/config/environment_spec.rb +138 -17
- data/spec/mongoid/config/options_spec.rb +26 -7
- data/spec/mongoid/config_spec.rb +607 -93
- data/spec/mongoid/contextual/aggregable/memory_spec.rb +433 -153
- data/spec/mongoid/contextual/aggregable/memory_table.yml +88 -0
- data/spec/mongoid/contextual/aggregable/memory_table_spec.rb +62 -0
- data/spec/mongoid/contextual/aggregable/mongo_spec.rb +221 -56
- data/spec/mongoid/contextual/aggregable/none_spec.rb +60 -0
- data/spec/mongoid/contextual/atomic_spec.rb +577 -162
- data/spec/mongoid/contextual/geo_near_spec.rb +104 -38
- data/spec/mongoid/contextual/map_reduce_spec.rb +137 -142
- data/spec/mongoid/contextual/memory_spec.rb +1880 -269
- data/spec/mongoid/contextual/mongo_spec.rb +2523 -601
- data/spec/mongoid/contextual/none_spec.rb +123 -0
- data/spec/mongoid/copyable_spec.rb +833 -76
- data/spec/mongoid/copyable_spec_models.rb +47 -0
- data/spec/mongoid/criteria/findable_spec.rb +1132 -0
- data/spec/mongoid/criteria/includable_spec.rb +1492 -0
- data/spec/mongoid/criteria/includable_spec_models.rb +54 -0
- data/spec/mongoid/criteria/inspectable_spec.rb +29 -0
- data/spec/mongoid/criteria/marshalable_spec.rb +47 -0
- data/spec/mongoid/criteria/modifiable_spec.rb +1812 -0
- data/spec/mongoid/criteria/options_spec.rb +31 -0
- data/spec/mongoid/criteria/queryable/aggregable_spec.rb +372 -0
- data/spec/mongoid/criteria/queryable/expandable_spec.rb +61 -0
- data/spec/mongoid/criteria/queryable/extensions/array_spec.rb +513 -0
- data/spec/mongoid/criteria/queryable/extensions/big_decimal_spec.rb +169 -0
- data/spec/mongoid/criteria/queryable/extensions/bignum_spec.rb +60 -0
- data/spec/mongoid/criteria/queryable/extensions/boolean_spec.rb +215 -0
- data/spec/mongoid/criteria/queryable/extensions/date_spec.rb +343 -0
- data/spec/mongoid/criteria/queryable/extensions/date_time_spec.rb +434 -0
- data/spec/mongoid/criteria/queryable/extensions/fixnum_spec.rb +60 -0
- data/spec/mongoid/criteria/queryable/extensions/float_spec.rb +67 -0
- data/spec/mongoid/criteria/queryable/extensions/hash_spec.rb +314 -0
- data/spec/mongoid/criteria/queryable/extensions/integer_spec.rb +67 -0
- data/spec/mongoid/criteria/queryable/extensions/nil_class_spec.rb +79 -0
- data/spec/mongoid/criteria/queryable/extensions/numeric_spec.rb +119 -0
- data/spec/mongoid/criteria/queryable/extensions/object_spec.rb +110 -0
- data/spec/mongoid/criteria/queryable/extensions/range_spec.rb +370 -0
- data/spec/mongoid/criteria/queryable/extensions/regexp_raw_spec.rb +91 -0
- data/spec/mongoid/criteria/queryable/extensions/regexp_spec.rb +92 -0
- data/spec/mongoid/criteria/queryable/extensions/set_spec.rb +41 -0
- data/spec/mongoid/criteria/queryable/extensions/string_spec.rb +347 -0
- data/spec/mongoid/criteria/queryable/extensions/symbol_spec.rb +169 -0
- data/spec/mongoid/criteria/queryable/extensions/time_spec.rb +406 -0
- data/spec/mongoid/criteria/queryable/extensions/time_with_zone_spec.rb +387 -0
- data/spec/mongoid/criteria/queryable/key_spec.rb +96 -0
- data/spec/mongoid/criteria/queryable/mergeable_spec.rb +182 -0
- data/spec/mongoid/criteria/queryable/optional_spec.rb +1317 -0
- data/spec/mongoid/criteria/queryable/options_spec.rb +362 -0
- data/spec/mongoid/criteria/queryable/pipeline_spec.rb +214 -0
- data/spec/mongoid/criteria/queryable/queryable_spec.rb +139 -0
- data/spec/mongoid/criteria/queryable/selectable_logical_spec.rb +2119 -0
- data/spec/mongoid/criteria/queryable/selectable_shared_examples.rb +38 -0
- data/spec/mongoid/criteria/queryable/selectable_spec.rb +2462 -0
- data/spec/mongoid/criteria/queryable/selectable_where_spec.rb +589 -0
- data/spec/mongoid/criteria/queryable/selector_spec.rb +895 -0
- data/spec/mongoid/criteria/queryable/smash_spec.rb +32 -0
- data/spec/mongoid/criteria/queryable/storable_spec.rb +226 -0
- data/spec/mongoid/criteria/scopable_spec.rb +601 -0
- data/spec/mongoid/criteria_projection_spec.rb +410 -0
- data/spec/mongoid/criteria_spec.rb +1828 -3572
- data/spec/mongoid/document_fields_spec.rb +262 -0
- data/spec/mongoid/document_persistence_context_spec.rb +32 -0
- data/spec/mongoid/document_query_spec.rb +89 -0
- data/spec/mongoid/document_spec.rb +452 -221
- data/spec/mongoid/equality_spec.rb +155 -52
- data/spec/mongoid/errors/ambiguous_relationship_spec.rb +8 -6
- data/spec/mongoid/errors/callback_spec.rb +5 -3
- data/spec/mongoid/errors/delete_restriction_spec.rb +7 -5
- data/spec/mongoid/errors/document_not_destroyed_spec.rb +35 -0
- data/spec/mongoid/errors/document_not_found_spec.rb +89 -11
- data/spec/mongoid/errors/invalid_collection_spec.rb +5 -3
- data/spec/mongoid/errors/invalid_config_file_spec.rb +31 -0
- data/spec/mongoid/errors/invalid_config_option_spec.rb +5 -3
- data/spec/mongoid/errors/invalid_field_option_spec.rb +5 -3
- data/spec/mongoid/errors/invalid_field_spec.rb +6 -4
- data/spec/mongoid/errors/invalid_field_type_spec.rb +55 -0
- data/spec/mongoid/errors/invalid_find_spec.rb +5 -3
- data/spec/mongoid/errors/invalid_includes_spec.rb +5 -3
- data/spec/mongoid/errors/invalid_index_spec.rb +5 -3
- data/spec/mongoid/errors/invalid_options_spec.rb +7 -5
- data/spec/mongoid/errors/invalid_path_spec.rb +5 -3
- data/spec/mongoid/errors/invalid_relation_spec.rb +39 -0
- data/spec/mongoid/errors/invalid_scope_spec.rb +7 -5
- data/spec/mongoid/errors/invalid_set_polymorphic_relation_spec.rb +5 -3
- data/spec/mongoid/errors/invalid_storage_options_spec.rb +5 -3
- data/spec/mongoid/errors/invalid_time_spec.rb +5 -3
- data/spec/mongoid/errors/inverse_not_found_spec.rb +6 -4
- data/spec/mongoid/errors/mixed_client_configuration_spec.rb +31 -0
- data/spec/mongoid/errors/mixed_relations_spec.rb +5 -3
- data/spec/mongoid/errors/mongoid_error_spec.rb +45 -10
- data/spec/mongoid/errors/nested_attributes_metadata_not_found_spec.rb +8 -6
- data/spec/mongoid/errors/no_client_config_spec.rb +31 -0
- data/spec/mongoid/errors/no_client_database_spec.rb +31 -0
- data/spec/mongoid/errors/no_client_hosts_spec.rb +31 -0
- data/spec/mongoid/errors/no_clients_config_spec.rb +31 -0
- data/spec/mongoid/errors/no_environment_spec.rb +8 -6
- data/spec/mongoid/errors/no_map_reduce_output_spec.rb +5 -3
- data/spec/mongoid/errors/no_metadata_spec.rb +5 -3
- data/spec/mongoid/errors/no_parent_spec.rb +6 -4
- data/spec/mongoid/errors/readonly_attribute_spec.rb +5 -3
- data/spec/mongoid/errors/readonly_document_spec.rb +31 -0
- data/spec/mongoid/errors/scope_overwrite_spec.rb +5 -3
- data/spec/mongoid/errors/too_many_nested_attribute_records_spec.rb +6 -4
- data/spec/mongoid/errors/unknown_attribute_spec.rb +7 -5
- data/spec/mongoid/errors/unsaved_document_spec.rb +6 -4
- data/spec/mongoid/errors/unsupported_javascript_spec.rb +5 -3
- data/spec/mongoid/errors/validations_spec.rb +9 -7
- data/spec/mongoid/extensions/array_spec.rb +108 -116
- data/spec/mongoid/extensions/big_decimal_spec.rb +838 -49
- data/spec/mongoid/extensions/binary_spec.rb +55 -18
- data/spec/mongoid/extensions/boolean_spec.rb +76 -74
- data/spec/mongoid/extensions/date_class_mongoize_spec.rb +339 -0
- data/spec/mongoid/extensions/date_spec.rb +59 -145
- data/spec/mongoid/extensions/date_time_spec.rb +35 -76
- data/spec/mongoid/extensions/decimal128_spec.rb +46 -0
- data/spec/mongoid/extensions/false_class_spec.rb +7 -5
- data/spec/mongoid/extensions/float_spec.rb +69 -62
- data/spec/mongoid/extensions/hash_spec.rb +197 -30
- data/spec/mongoid/extensions/integer_spec.rb +63 -65
- data/spec/mongoid/extensions/module_spec.rb +4 -2
- data/spec/mongoid/extensions/nil_class_spec.rb +3 -1
- data/spec/mongoid/extensions/object_id_spec.rb +136 -134
- data/spec/mongoid/extensions/object_spec.rb +53 -57
- data/spec/mongoid/extensions/range_spec.rb +287 -28
- data/spec/mongoid/extensions/regexp_spec.rb +71 -21
- data/spec/mongoid/extensions/set_spec.rb +112 -4
- data/spec/mongoid/extensions/string_spec.rb +188 -89
- data/spec/mongoid/extensions/stringified_symbol_spec.rb +84 -0
- data/spec/mongoid/extensions/symbol_spec.rb +25 -30
- data/spec/mongoid/extensions/time_spec.rb +703 -110
- data/spec/mongoid/extensions/time_with_zone_spec.rb +82 -67
- data/spec/mongoid/extensions/true_class_spec.rb +7 -5
- data/spec/mongoid/extensions_spec.rb +43 -0
- data/spec/mongoid/factory_spec.rb +374 -25
- data/spec/mongoid/fields/foreign_key_spec.rb +116 -92
- data/spec/mongoid/fields/localized_spec.rb +177 -35
- data/spec/mongoid/fields/standard_spec.rb +15 -13
- data/spec/mongoid/fields_spec.rb +952 -238
- data/spec/mongoid/findable_spec.rb +632 -0
- data/spec/mongoid/indexable/specification_spec.rb +129 -0
- data/spec/mongoid/indexable_spec.rb +643 -0
- data/spec/mongoid/inspectable_spec.rb +86 -0
- data/spec/mongoid/interceptable_spec.rb +2373 -0
- data/spec/mongoid/interceptable_spec_models.rb +307 -0
- data/spec/mongoid/loggable_spec.rb +3 -1
- data/spec/mongoid/matcher/extract_attribute_data/numeric_keys.yml +104 -0
- data/spec/mongoid/matcher/extract_attribute_data/traversal.yml +239 -0
- data/spec/mongoid/matcher/extract_attribute_spec.rb +36 -0
- data/spec/mongoid/mongoizable_spec.rb +285 -0
- data/spec/mongoid/persistable/creatable_spec.rb +662 -0
- data/spec/mongoid/persistable/deletable_spec.rb +514 -0
- data/spec/mongoid/persistable/destroyable_spec.rb +455 -0
- data/spec/mongoid/persistable/incrementable_spec.rb +241 -0
- data/spec/mongoid/persistable/logical_spec.rb +159 -0
- data/spec/mongoid/persistable/poppable_spec.rb +131 -0
- data/spec/mongoid/persistable/pullable_spec.rb +258 -0
- data/spec/mongoid/persistable/pushable_spec.rb +353 -0
- data/spec/mongoid/persistable/renamable_spec.rb +151 -0
- data/spec/mongoid/persistable/savable_spec.rb +684 -0
- data/spec/mongoid/persistable/settable_spec.rb +544 -0
- data/spec/mongoid/persistable/unsettable_spec.rb +171 -0
- data/spec/mongoid/persistable/updatable_spec.rb +760 -0
- data/spec/mongoid/persistable/upsertable_spec.rb +122 -0
- data/spec/mongoid/persistable_spec.rb +321 -0
- data/spec/mongoid/persistence_context_spec.rb +745 -0
- data/spec/mongoid/positional_spec.rb +223 -0
- data/spec/mongoid/query_cache_middleware_spec.rb +50 -0
- data/spec/mongoid/query_cache_spec.rb +870 -0
- data/spec/mongoid/relations/proxy_spec.rb +125 -47
- data/spec/mongoid/reloadable_spec.rb +665 -0
- data/spec/mongoid/scopable_spec.rb +1234 -0
- data/spec/mongoid/selectable_spec.rb +136 -0
- data/spec/mongoid/serializable_spec.rb +963 -0
- data/spec/mongoid/shardable_models.rb +61 -0
- data/spec/mongoid/shardable_spec.rb +204 -0
- data/spec/mongoid/stateful_spec.rb +157 -0
- data/spec/mongoid/tasks/database_rake_spec.rb +287 -0
- data/spec/mongoid/tasks/database_spec.rb +181 -0
- data/spec/mongoid/threaded_spec.rb +88 -78
- data/spec/mongoid/timestamps/created/short_spec.rb +9 -7
- data/spec/mongoid/timestamps/created_spec.rb +8 -6
- data/spec/mongoid/timestamps/timeless_spec.rb +29 -10
- data/spec/mongoid/timestamps/updated/short_spec.rb +16 -14
- data/spec/mongoid/timestamps/updated_spec.rb +14 -16
- data/spec/mongoid/timestamps_spec.rb +406 -18
- data/spec/mongoid/timestamps_spec_models.rb +67 -0
- data/spec/mongoid/touchable_spec.rb +704 -0
- data/spec/mongoid/touchable_spec_models.rb +57 -0
- data/spec/mongoid/traversable_spec.rb +1410 -0
- data/spec/mongoid/validatable/associated_spec.rb +208 -0
- data/spec/mongoid/validatable/format_spec.rb +85 -0
- data/spec/mongoid/validatable/length_spec.rb +225 -0
- data/spec/mongoid/validatable/numericality_spec.rb +32 -0
- data/spec/mongoid/validatable/presence_spec.rb +592 -0
- data/spec/mongoid/validatable/uniqueness_spec.rb +2504 -0
- data/spec/mongoid/validatable_spec.rb +327 -0
- data/spec/mongoid/warnings_spec.rb +35 -0
- data/spec/mongoid_spec.rb +20 -20
- data/spec/rails/controller_extension/controller_runtime_spec.rb +112 -0
- data/spec/rails/mongoid_spec.rb +37 -354
- data/spec/shared/LICENSE +20 -0
- data/spec/shared/bin/get-mongodb-download-url +17 -0
- data/spec/shared/bin/s3-copy +45 -0
- data/spec/shared/bin/s3-upload +69 -0
- data/spec/shared/lib/mrss/child_process_helper.rb +80 -0
- data/spec/shared/lib/mrss/cluster_config.rb +231 -0
- data/spec/shared/lib/mrss/constraints.rb +378 -0
- data/spec/shared/lib/mrss/docker_runner.rb +291 -0
- data/spec/shared/lib/mrss/eg_config_utils.rb +51 -0
- data/spec/shared/lib/mrss/event_subscriber.rb +200 -0
- data/spec/shared/lib/mrss/lite_constraints.rb +230 -0
- data/spec/shared/lib/mrss/server_version_registry.rb +120 -0
- data/spec/shared/lib/mrss/session_registry.rb +69 -0
- data/spec/shared/lib/mrss/session_registry_legacy.rb +60 -0
- data/spec/shared/lib/mrss/spec_organizer.rb +179 -0
- data/spec/shared/lib/mrss/utils.rb +15 -0
- data/spec/shared/share/Dockerfile.erb +325 -0
- data/spec/shared/share/haproxy-1.conf +16 -0
- data/spec/shared/share/haproxy-2.conf +17 -0
- data/spec/shared/shlib/config.sh +27 -0
- data/spec/shared/shlib/distro.sh +74 -0
- data/spec/shared/shlib/server.sh +392 -0
- data/spec/shared/shlib/set_env.sh +169 -0
- data/spec/spec_helper.rb +163 -42
- data/spec/support/authorization.rb +15 -0
- data/spec/support/client_registry.rb +9 -0
- data/spec/support/constraints.rb +77 -0
- data/spec/support/expectations.rb +32 -0
- data/spec/support/helpers.rb +11 -0
- data/spec/support/macros.rb +81 -0
- data/spec/support/models/account.rb +38 -0
- data/spec/support/models/acolyte.rb +19 -0
- data/spec/support/models/actor.rb +20 -0
- data/spec/support/models/actress.rb +4 -0
- data/spec/support/models/address.rb +85 -0
- data/spec/support/models/address_component.rb +7 -0
- data/spec/support/models/address_number.rb +8 -0
- data/spec/support/models/agency.rb +7 -0
- data/spec/support/models/agent.rb +18 -0
- data/spec/support/models/album.rb +20 -0
- data/spec/support/models/alert.rb +9 -0
- data/spec/support/models/animal.rb +28 -0
- data/spec/support/models/answer.rb +8 -0
- data/spec/support/models/appointment.rb +9 -0
- data/spec/support/models/armrest.rb +9 -0
- data/spec/support/models/array_field.rb +7 -0
- data/spec/support/models/article.rb +14 -0
- data/spec/support/models/artist.rb +91 -0
- data/spec/support/models/artwork.rb +6 -0
- data/spec/support/models/audible_sound.rb +3 -0
- data/spec/support/models/audio.rb +7 -0
- data/spec/support/models/augmentation.rb +25 -0
- data/spec/support/models/author.rb +8 -0
- data/spec/support/models/baby.rb +6 -0
- data/spec/support/models/band.rb +40 -0
- data/spec/support/models/bar.rb +12 -0
- data/spec/support/models/basic.rb +8 -0
- data/spec/support/models/bed.rb +3 -0
- data/spec/support/models/big_palette.rb +4 -0
- data/spec/support/models/birthday.rb +15 -0
- data/spec/support/models/bolt.rb +7 -0
- data/spec/support/models/bomb.rb +6 -0
- data/spec/support/models/book.rb +18 -0
- data/spec/support/models/breed.rb +6 -0
- data/spec/support/models/browser.rb +8 -0
- data/spec/support/models/building.rb +8 -0
- data/spec/support/models/building_address.rb +9 -0
- data/spec/support/models/bus.rb +9 -0
- data/spec/support/models/business.rb +7 -0
- data/spec/support/models/callback_test.rb +11 -0
- data/spec/support/models/canvas.rb +27 -0
- data/spec/support/models/car.rb +3 -0
- data/spec/support/models/cat.rb +10 -0
- data/spec/support/models/catalog.rb +24 -0
- data/spec/support/models/category.rb +10 -0
- data/spec/support/models/child.rb +6 -0
- data/spec/support/models/child_doc.rb +24 -0
- data/spec/support/models/church.rb +8 -0
- data/spec/support/models/circle.rb +5 -0
- data/spec/support/models/circuit.rb +6 -0
- data/spec/support/models/circus.rb +12 -0
- data/spec/support/models/code.rb +15 -0
- data/spec/support/models/coding/pull_request.rb +11 -0
- data/spec/support/models/coding.rb +3 -0
- data/spec/support/models/comment.rb +18 -0
- data/spec/support/models/company.rb +7 -0
- data/spec/support/models/consumption_period.rb +9 -0
- data/spec/support/models/contextable_item.rb +7 -0
- data/spec/support/models/contractor.rb +7 -0
- data/spec/support/models/cookie.rb +8 -0
- data/spec/support/models/country_code.rb +12 -0
- data/spec/support/models/courier_job.rb +6 -0
- data/spec/support/models/crate.rb +12 -0
- data/spec/support/models/customer.rb +10 -0
- data/spec/support/models/customer_address.rb +11 -0
- data/spec/support/models/deed.rb +7 -0
- data/spec/support/models/definition.rb +11 -0
- data/spec/support/models/delegating_patient.rb +15 -0
- data/spec/support/models/description.rb +13 -0
- data/spec/support/models/dictionary.rb +18 -0
- data/spec/support/models/division.rb +12 -0
- data/spec/support/models/doctor.rb +14 -0
- data/spec/support/models/dog.rb +9 -0
- data/spec/support/models/dokument.rb +8 -0
- data/spec/support/models/draft.rb +11 -0
- data/spec/support/models/dragon.rb +6 -0
- data/spec/support/models/driver.rb +9 -0
- data/spec/support/models/drug.rb +8 -0
- data/spec/support/models/dungeon.rb +6 -0
- data/spec/support/models/edit.rb +7 -0
- data/spec/support/models/email.rb +8 -0
- data/spec/support/models/employer.rb +7 -0
- data/spec/support/models/entry.rb +8 -0
- data/spec/support/models/eraser.rb +3 -0
- data/spec/support/models/even.rb +9 -0
- data/spec/support/models/event.rb +24 -0
- data/spec/support/models/exhibition.rb +6 -0
- data/spec/support/models/exhibitor.rb +8 -0
- data/spec/support/models/explosion.rb +6 -0
- data/spec/support/models/eye.rb +11 -0
- data/spec/support/models/eye_bowl.rb +11 -0
- data/spec/support/models/face.rb +10 -0
- data/spec/support/models/fanatic.rb +8 -0
- data/spec/support/models/favorite.rb +8 -0
- data/spec/support/models/filesystem.rb +7 -0
- data/spec/support/models/fire_hydrant.rb +8 -0
- data/spec/support/models/firefox.rb +6 -0
- data/spec/support/models/fish.rb +9 -0
- data/spec/support/models/folder.rb +9 -0
- data/spec/support/models/folder_item.rb +11 -0
- data/spec/support/models/fruits.rb +36 -0
- data/spec/support/models/game.rb +21 -0
- data/spec/support/models/ghost.rb +9 -0
- data/spec/support/models/guitar.rb +4 -0
- data/spec/support/models/hole.rb +12 -0
- data/spec/support/models/home.rb +6 -0
- data/spec/support/models/house.rb +8 -0
- data/spec/support/models/html_writer.rb +5 -0
- data/spec/support/models/id_key.rb +8 -0
- data/spec/support/models/idnodef.rb +7 -0
- data/spec/support/models/image.rb +24 -0
- data/spec/support/models/implant.rb +27 -0
- data/spec/support/models/instrument.rb +8 -0
- data/spec/support/models/item.rb +10 -0
- data/spec/support/models/jar.rb +9 -0
- data/spec/support/models/kaleidoscope.rb +8 -0
- data/spec/support/models/kangaroo.rb +6 -0
- data/spec/support/models/label.rb +52 -0
- data/spec/support/models/language.rb +7 -0
- data/spec/support/models/lat_lng.rb +17 -0
- data/spec/support/models/league.rb +13 -0
- data/spec/support/models/learner.rb +4 -0
- data/spec/support/models/line_item.rb +8 -0
- data/spec/support/models/location.rb +10 -0
- data/spec/support/models/login.rb +10 -0
- data/spec/support/models/manufacturer.rb +9 -0
- data/spec/support/models/meat.rb +6 -0
- data/spec/support/models/membership.rb +7 -0
- data/spec/support/models/message.rb +13 -0
- data/spec/support/models/minim.rb +6 -0
- data/spec/support/models/mixed_drink.rb +6 -0
- data/spec/support/models/mop.rb +24 -0
- data/spec/support/models/movie.rb +15 -0
- data/spec/support/models/my_hash.rb +4 -0
- data/spec/support/models/name.rb +26 -0
- data/spec/support/models/name_only.rb +8 -0
- data/spec/support/models/node.rb +7 -0
- data/spec/support/models/note.rb +19 -0
- data/spec/support/models/nut.rb +7 -0
- data/spec/support/models/odd.rb +9 -0
- data/spec/support/models/order.rb +12 -0
- data/spec/support/models/ordered_post.rb +13 -0
- data/spec/support/models/ordered_preference.rb +8 -0
- data/spec/support/models/oscar.rb +16 -0
- data/spec/support/models/other_owner_object.rb +4 -0
- data/spec/support/models/override.rb +18 -0
- data/spec/support/models/ownable.rb +8 -0
- data/spec/support/models/owner.rb +10 -0
- data/spec/support/models/pack.rb +5 -0
- data/spec/support/models/page.rb +18 -0
- data/spec/support/models/page_question.rb +6 -0
- data/spec/support/models/palette.rb +9 -0
- data/spec/support/models/parent.rb +7 -0
- data/spec/support/models/parent_doc.rb +8 -0
- data/spec/support/models/passport.rb +22 -0
- data/spec/support/models/patient.rb +11 -0
- data/spec/support/models/pdf_writer.rb +5 -0
- data/spec/support/models/pencil.rb +3 -0
- data/spec/support/models/person.rb +231 -0
- data/spec/support/models/pet.rb +25 -0
- data/spec/support/models/pet_owner.rb +8 -0
- data/spec/support/models/phone.rb +13 -0
- data/spec/support/models/piano.rb +4 -0
- data/spec/support/models/pizza.rb +9 -0
- data/spec/support/models/player.rb +39 -0
- data/spec/support/models/post.rb +52 -0
- data/spec/support/models/post_genre.rb +8 -0
- data/spec/support/models/powerup.rb +25 -0
- data/spec/support/models/preference.rb +11 -0
- data/spec/support/models/princess.rb +12 -0
- data/spec/support/models/product.rb +19 -0
- data/spec/support/models/profile.rb +17 -0
- data/spec/support/models/pronunciation.rb +7 -0
- data/spec/support/models/pub.rb +8 -0
- data/spec/support/models/publication/encyclopedia.rb +11 -0
- data/spec/support/models/publication/review.rb +13 -0
- data/spec/support/models/publication.rb +4 -0
- data/spec/support/models/purchase.rb +6 -0
- data/spec/support/models/purchased_item.rb +10 -0
- data/spec/support/models/question.rb +10 -0
- data/spec/support/models/quiz.rb +9 -0
- data/spec/support/models/rating.rb +10 -0
- data/spec/support/models/record.rb +54 -0
- data/spec/support/models/registry.rb +7 -0
- data/spec/support/models/role.rb +9 -0
- data/spec/support/models/root_category.rb +6 -0
- data/spec/support/models/sandwich.rb +11 -0
- data/spec/support/models/scheduler.rb +9 -0
- data/spec/support/models/school.rb +14 -0
- data/spec/support/models/scribe.rb +7 -0
- data/spec/support/models/sealer.rb +7 -0
- data/spec/support/models/seat.rb +24 -0
- data/spec/support/models/seo.rb +9 -0
- data/spec/support/models/series.rb +7 -0
- data/spec/support/models/server.rb +15 -0
- data/spec/support/models/service.rb +24 -0
- data/spec/support/models/shape.rb +14 -0
- data/spec/support/models/shelf.rb +7 -0
- data/spec/support/models/shield.rb +18 -0
- data/spec/support/models/shipment_address.rb +5 -0
- data/spec/support/models/shipping_container.rb +7 -0
- data/spec/support/models/shipping_pack.rb +5 -0
- data/spec/support/models/shirt.rb +11 -0
- data/spec/support/models/shop.rb +8 -0
- data/spec/support/models/short_agent.rb +6 -0
- data/spec/support/models/short_quiz.rb +7 -0
- data/spec/support/models/simple.rb +7 -0
- data/spec/support/models/slave.rb +8 -0
- data/spec/support/models/song.rb +10 -0
- data/spec/support/models/sound.rb +7 -0
- data/spec/support/models/spacer.rb +7 -0
- data/spec/support/models/square.rb +6 -0
- data/spec/support/models/staff.rb +9 -0
- data/spec/support/models/store_as_dup_test1.rb +7 -0
- data/spec/support/models/store_as_dup_test2.rb +7 -0
- data/spec/support/models/store_as_dup_test3.rb +7 -0
- data/spec/support/models/store_as_dup_test4.rb +7 -0
- data/spec/support/models/strategy.rb +5 -0
- data/spec/support/models/student.rb +14 -0
- data/spec/support/models/sub_item.rb +5 -0
- data/spec/support/models/subscription.rb +7 -0
- data/spec/support/models/survey.rb +7 -0
- data/spec/support/models/symptom.rb +8 -0
- data/spec/support/models/system_role.rb +7 -0
- data/spec/support/models/tag.rb +10 -0
- data/spec/support/models/target.rb +7 -0
- data/spec/support/models/template.rb +7 -0
- data/spec/support/models/thing.rb +11 -0
- data/spec/support/models/threadlocker.rb +7 -0
- data/spec/support/models/title.rb +5 -0
- data/spec/support/models/tool.rb +10 -0
- data/spec/support/models/topping.rb +7 -0
- data/spec/support/models/toy.rb +9 -0
- data/spec/support/models/track.rb +40 -0
- data/spec/support/models/translation.rb +7 -0
- data/spec/support/models/tree.rb +11 -0
- data/spec/support/models/truck.rb +7 -0
- data/spec/support/models/updatable.rb +7 -0
- data/spec/support/models/user.rb +23 -0
- data/spec/support/models/user_account.rb +12 -0
- data/spec/support/models/validation_callback.rb +12 -0
- data/spec/support/models/vehicle.rb +18 -0
- data/spec/support/models/version.rb +7 -0
- data/spec/support/models/vertex.rb +8 -0
- data/spec/support/models/vet_visit.rb +7 -0
- data/spec/support/models/video.rb +15 -0
- data/spec/support/models/video_game.rb +3 -0
- data/spec/support/models/washer.rb +7 -0
- data/spec/support/models/weapon.rb +25 -0
- data/spec/support/models/wiki_page.rb +17 -0
- data/spec/support/models/word.rb +17 -0
- data/spec/support/models/word_origin.rb +13 -0
- data/spec/support/models/writer.rb +13 -0
- data/spec/support/schema_maps/schema_map_aws.json +17 -0
- data/spec/support/schema_maps/schema_map_aws_key_alt_names.json +12 -0
- data/spec/support/schema_maps/schema_map_azure.json +17 -0
- data/spec/support/schema_maps/schema_map_azure_key_alt_names.json +12 -0
- data/spec/support/schema_maps/schema_map_gcp.json +17 -0
- data/spec/support/schema_maps/schema_map_gcp_key_alt_names.json +12 -0
- data/spec/support/schema_maps/schema_map_kmip.json +17 -0
- data/spec/support/schema_maps/schema_map_kmip_key_alt_names.json +12 -0
- data/spec/support/schema_maps/schema_map_local.json +18 -0
- data/spec/support/schema_maps/schema_map_local_key_alt_names.json +12 -0
- data/spec/support/shared/time.rb +53 -0
- data/spec/support/spec_config.rb +64 -0
- data.tar.gz.sig +0 -0
- metadata +1582 -912
- metadata.gz.sig +0 -0
- data/lib/mongoid/atomic/positionable.rb +0 -73
- data/lib/mongoid/callbacks.rb +0 -314
- data/lib/mongoid/components.rb +0 -93
- data/lib/mongoid/config/inflections.rb +0 -6
- data/lib/mongoid/config/validators/session.rb +0 -140
- data/lib/mongoid/contextual/eager.rb +0 -158
- data/lib/mongoid/contextual/find_and_modify.rb +0 -69
- data/lib/mongoid/criterion/findable.rb +0 -179
- data/lib/mongoid/criterion/inspection.rb +0 -25
- data/lib/mongoid/criterion/marshalable.rb +0 -48
- data/lib/mongoid/criterion/modifiable.rb +0 -189
- data/lib/mongoid/criterion/scoping.rb +0 -158
- data/lib/mongoid/dirty.rb +0 -376
- data/lib/mongoid/errors/eager_load.rb +0 -22
- data/lib/mongoid/errors/mixed_session_configuration.rb +0 -28
- data/lib/mongoid/errors/no_default_session.rb +0 -23
- data/lib/mongoid/errors/no_session_config.rb +0 -22
- data/lib/mongoid/errors/no_session_database.rb +0 -27
- data/lib/mongoid/errors/no_session_hosts.rb +0 -27
- data/lib/mongoid/errors/no_sessions_config.rb +0 -20
- data/lib/mongoid/errors/versioning_not_on_root.rb +0 -23
- data/lib/mongoid/finders.rb +0 -130
- data/lib/mongoid/hierarchy.rb +0 -188
- data/lib/mongoid/identity_map.rb +0 -163
- data/lib/mongoid/indexes/validators/options.rb +0 -102
- data/lib/mongoid/indexes.rb +0 -154
- data/lib/mongoid/inspection.rb +0 -55
- data/lib/mongoid/json.rb +0 -16
- data/lib/mongoid/matchers/all.rb +0 -27
- data/lib/mongoid/matchers/and.rb +0 -30
- data/lib/mongoid/matchers/default.rb +0 -72
- data/lib/mongoid/matchers/exists.rb +0 -23
- data/lib/mongoid/matchers/gt.rb +0 -21
- data/lib/mongoid/matchers/gte.rb +0 -21
- data/lib/mongoid/matchers/in.rb +0 -24
- data/lib/mongoid/matchers/lt.rb +0 -21
- data/lib/mongoid/matchers/lte.rb +0 -21
- data/lib/mongoid/matchers/ne.rb +0 -21
- data/lib/mongoid/matchers/nin.rb +0 -21
- data/lib/mongoid/matchers/or.rb +0 -33
- data/lib/mongoid/matchers/size.rb +0 -21
- data/lib/mongoid/matchers/strategies.rb +0 -97
- data/lib/mongoid/matchers.rb +0 -32
- data/lib/mongoid/multi_parameter_attributes.rb +0 -105
- data/lib/mongoid/nested_attributes.rb +0 -78
- data/lib/mongoid/observer.rb +0 -192
- data/lib/mongoid/paranoia.rb +0 -137
- data/lib/mongoid/persistence/atomic/add_to_set.rb +0 -47
- data/lib/mongoid/persistence/atomic/bit.rb +0 -35
- data/lib/mongoid/persistence/atomic/inc.rb +0 -45
- data/lib/mongoid/persistence/atomic/operation.rb +0 -154
- data/lib/mongoid/persistence/atomic/pop.rb +0 -32
- data/lib/mongoid/persistence/atomic/pull.rb +0 -32
- data/lib/mongoid/persistence/atomic/pull_all.rb +0 -32
- data/lib/mongoid/persistence/atomic/push.rb +0 -25
- data/lib/mongoid/persistence/atomic/push_all.rb +0 -25
- data/lib/mongoid/persistence/atomic/rename.rb +0 -30
- data/lib/mongoid/persistence/atomic/sets.rb +0 -28
- data/lib/mongoid/persistence/atomic/unset.rb +0 -27
- data/lib/mongoid/persistence/atomic.rb +0 -231
- data/lib/mongoid/persistence/deletion.rb +0 -32
- data/lib/mongoid/persistence/insertion.rb +0 -38
- data/lib/mongoid/persistence/modification.rb +0 -35
- data/lib/mongoid/persistence/operations/embedded/insert.rb +0 -46
- data/lib/mongoid/persistence/operations/embedded/remove.rb +0 -43
- data/lib/mongoid/persistence/operations/insert.rb +0 -34
- data/lib/mongoid/persistence/operations/remove.rb +0 -33
- data/lib/mongoid/persistence/operations/update.rb +0 -59
- data/lib/mongoid/persistence/operations/upsert.rb +0 -28
- data/lib/mongoid/persistence/operations.rb +0 -214
- data/lib/mongoid/persistence/upsertion.rb +0 -31
- data/lib/mongoid/persistence.rb +0 -352
- data/lib/mongoid/railties/document.rb +0 -12
- data/lib/mongoid/relations/accessors.rb +0 -299
- data/lib/mongoid/relations/auto_save.rb +0 -107
- data/lib/mongoid/relations/binding.rb +0 -241
- data/lib/mongoid/relations/bindings/embedded/in.rb +0 -63
- data/lib/mongoid/relations/bindings/embedded/many.rb +0 -52
- data/lib/mongoid/relations/bindings/embedded/one.rb +0 -55
- data/lib/mongoid/relations/bindings/referenced/in.rb +0 -70
- data/lib/mongoid/relations/bindings/referenced/many.rb +0 -42
- data/lib/mongoid/relations/bindings/referenced/many_to_many.rb +0 -67
- data/lib/mongoid/relations/bindings/referenced/one.rb +0 -44
- data/lib/mongoid/relations/bindings.rb +0 -9
- data/lib/mongoid/relations/builder.rb +0 -57
- data/lib/mongoid/relations/builders/embedded/in.rb +0 -29
- data/lib/mongoid/relations/builders/embedded/many.rb +0 -36
- data/lib/mongoid/relations/builders/embedded/one.rb +0 -30
- data/lib/mongoid/relations/builders/nested_attributes/many.rb +0 -177
- data/lib/mongoid/relations/builders/nested_attributes/one.rb +0 -127
- data/lib/mongoid/relations/builders/referenced/in.rb +0 -26
- data/lib/mongoid/relations/builders/referenced/many.rb +0 -27
- data/lib/mongoid/relations/builders/referenced/many_to_many.rb +0 -40
- data/lib/mongoid/relations/builders/referenced/one.rb +0 -26
- data/lib/mongoid/relations/builders.rb +0 -104
- data/lib/mongoid/relations/cascading/delete.rb +0 -44
- data/lib/mongoid/relations/cascading/destroy.rb +0 -43
- data/lib/mongoid/relations/cascading/nullify.rb +0 -35
- data/lib/mongoid/relations/cascading/restrict.rb +0 -39
- data/lib/mongoid/relations/cascading.rb +0 -58
- data/lib/mongoid/relations/constraint.rb +0 -49
- data/lib/mongoid/relations/conversions.rb +0 -34
- data/lib/mongoid/relations/counter_cache.rb +0 -107
- data/lib/mongoid/relations/cyclic.rb +0 -107
- data/lib/mongoid/relations/embedded/batchable.rb +0 -356
- data/lib/mongoid/relations/embedded/in.rb +0 -231
- data/lib/mongoid/relations/embedded/many.rb +0 -659
- data/lib/mongoid/relations/embedded/one.rb +0 -223
- data/lib/mongoid/relations/macros.rb +0 -359
- data/lib/mongoid/relations/many.rb +0 -217
- data/lib/mongoid/relations/marshalable.rb +0 -32
- data/lib/mongoid/relations/metadata.rb +0 -1227
- data/lib/mongoid/relations/nested_builder.rb +0 -74
- data/lib/mongoid/relations/one.rb +0 -60
- data/lib/mongoid/relations/options.rb +0 -48
- data/lib/mongoid/relations/polymorphic.rb +0 -40
- data/lib/mongoid/relations/proxy.rb +0 -264
- data/lib/mongoid/relations/referenced/in.rb +0 -314
- data/lib/mongoid/relations/referenced/many.rb +0 -789
- data/lib/mongoid/relations/referenced/many_to_many.rb +0 -495
- data/lib/mongoid/relations/referenced/one.rb +0 -297
- data/lib/mongoid/relations/reflections.rb +0 -62
- data/lib/mongoid/relations/synchronization.rb +0 -169
- data/lib/mongoid/relations/targets/enumerable.rb +0 -473
- data/lib/mongoid/relations/targets.rb +0 -2
- data/lib/mongoid/relations/touchable.rb +0 -61
- data/lib/mongoid/relations.rb +0 -162
- data/lib/mongoid/reloading.rb +0 -92
- data/lib/mongoid/scoping.rb +0 -356
- data/lib/mongoid/serialization.rb +0 -161
- data/lib/mongoid/sessions/factory.rb +0 -129
- data/lib/mongoid/sessions/mongo_uri.rb +0 -93
- data/lib/mongoid/sessions/validators/storage.rb +0 -49
- data/lib/mongoid/sessions/validators.rb +0 -2
- data/lib/mongoid/sessions.rb +0 -433
- data/lib/mongoid/sharding.rb +0 -61
- data/lib/mongoid/state.rb +0 -97
- data/lib/mongoid/unit_of_work.rb +0 -61
- data/lib/mongoid/validations/associated.rb +0 -46
- data/lib/mongoid/validations/format.rb +0 -20
- data/lib/mongoid/validations/length.rb +0 -20
- data/lib/mongoid/validations/localizable.rb +0 -30
- data/lib/mongoid/validations/macros.rb +0 -93
- data/lib/mongoid/validations/presence.rb +0 -86
- data/lib/mongoid/validations/queryable.rb +0 -31
- data/lib/mongoid/validations/uniqueness.rb +0 -330
- data/lib/mongoid/validations.rb +0 -166
- data/lib/mongoid/versioning.rb +0 -217
- data/lib/rack/mongoid/middleware/identity_map.rb +0 -39
- data/lib/rack/mongoid.rb +0 -2
- data/lib/rails/generators/mongoid/observer/observer_generator.rb +0 -17
- data/lib/rails/generators/mongoid/observer/templates/observer.rb.tt +0 -4
- data/lib/support/ruby_version.rb +0 -26
- data/spec/app/models/account.rb +0 -32
- data/spec/app/models/acolyte.rb +0 -16
- data/spec/app/models/actor.rb +0 -19
- data/spec/app/models/actor_observer.rb +0 -15
- data/spec/app/models/actress.rb +0 -2
- data/spec/app/models/address.rb +0 -72
- data/spec/app/models/address_component.rb +0 -5
- data/spec/app/models/address_number.rb +0 -6
- data/spec/app/models/agency.rb +0 -5
- data/spec/app/models/agent.rb +0 -12
- data/spec/app/models/album.rb +0 -14
- data/spec/app/models/alert.rb +0 -5
- data/spec/app/models/animal.rb +0 -25
- data/spec/app/models/answer.rb +0 -4
- data/spec/app/models/appointment.rb +0 -7
- data/spec/app/models/article.rb +0 -13
- data/spec/app/models/artist.rb +0 -66
- data/spec/app/models/artwork.rb +0 -4
- data/spec/app/models/augmentation.rb +0 -11
- data/spec/app/models/author.rb +0 -6
- data/spec/app/models/band.rb +0 -25
- data/spec/app/models/bar.rb +0 -9
- data/spec/app/models/basic.rb +0 -6
- data/spec/app/models/bed.rb +0 -1
- data/spec/app/models/big_palette.rb +0 -2
- data/spec/app/models/birthday.rb +0 -13
- data/spec/app/models/book.rb +0 -12
- data/spec/app/models/breed.rb +0 -4
- data/spec/app/models/browser.rb +0 -6
- data/spec/app/models/building.rb +0 -7
- data/spec/app/models/building_address.rb +0 -7
- data/spec/app/models/bus.rb +0 -7
- data/spec/app/models/business.rb +0 -5
- data/spec/app/models/callback_recorder.rb +0 -25
- data/spec/app/models/callback_test.rb +0 -9
- data/spec/app/models/canvas.rb +0 -25
- data/spec/app/models/car.rb +0 -1
- data/spec/app/models/cat.rb +0 -8
- data/spec/app/models/category.rb +0 -8
- data/spec/app/models/child.rb +0 -4
- data/spec/app/models/child_doc.rb +0 -22
- data/spec/app/models/church.rb +0 -4
- data/spec/app/models/circle.rb +0 -3
- data/spec/app/models/circuit.rb +0 -4
- data/spec/app/models/circus.rb +0 -7
- data/spec/app/models/code.rb +0 -5
- data/spec/app/models/comment.rb +0 -16
- data/spec/app/models/contractor.rb +0 -7
- data/spec/app/models/cookie.rb +0 -6
- data/spec/app/models/country_code.rb +0 -8
- data/spec/app/models/definition.rb +0 -8
- data/spec/app/models/description.rb +0 -11
- data/spec/app/models/dictionary.rb +0 -10
- data/spec/app/models/division.rb +0 -10
- data/spec/app/models/doctor.rb +0 -12
- data/spec/app/models/dog.rb +0 -7
- data/spec/app/models/dokument.rb +0 -5
- data/spec/app/models/driver.rb +0 -7
- data/spec/app/models/drug.rb +0 -8
- data/spec/app/models/email.rb +0 -6
- data/spec/app/models/employer.rb +0 -5
- data/spec/app/models/entry.rb +0 -6
- data/spec/app/models/eraser.rb +0 -1
- data/spec/app/models/event.rb +0 -22
- data/spec/app/models/exhibition.rb +0 -4
- data/spec/app/models/exhibitor.rb +0 -5
- data/spec/app/models/eye.rb +0 -9
- data/spec/app/models/eye_bowl.rb +0 -9
- data/spec/app/models/face.rb +0 -8
- data/spec/app/models/favorite.rb +0 -6
- data/spec/app/models/filesystem.rb +0 -4
- data/spec/app/models/fire_hydrant.rb +0 -6
- data/spec/app/models/firefox.rb +0 -4
- data/spec/app/models/fish.rb +0 -8
- data/spec/app/models/folder.rb +0 -7
- data/spec/app/models/folder_item.rb +0 -9
- data/spec/app/models/fruits.rb +0 -28
- data/spec/app/models/game.rb +0 -21
- data/spec/app/models/ghost.rb +0 -7
- data/spec/app/models/home.rb +0 -4
- data/spec/app/models/house.rb +0 -8
- data/spec/app/models/html_writer.rb +0 -3
- data/spec/app/models/image.rb +0 -22
- data/spec/app/models/implant.rb +0 -16
- data/spec/app/models/item.rb +0 -12
- data/spec/app/models/jar.rb +0 -7
- data/spec/app/models/label.rb +0 -40
- data/spec/app/models/language.rb +0 -5
- data/spec/app/models/lat_lng.rb +0 -15
- data/spec/app/models/league.rb +0 -11
- data/spec/app/models/learner.rb +0 -2
- data/spec/app/models/line_item.rb +0 -6
- data/spec/app/models/location.rb +0 -8
- data/spec/app/models/login.rb +0 -8
- data/spec/app/models/manufacturer.rb +0 -7
- data/spec/app/models/meat.rb +0 -4
- data/spec/app/models/membership.rb +0 -4
- data/spec/app/models/mixed_drink.rb +0 -4
- data/spec/app/models/movie.rb +0 -12
- data/spec/app/models/my_hash.rb +0 -2
- data/spec/app/models/name.rb +0 -23
- data/spec/app/models/node.rb +0 -5
- data/spec/app/models/note.rb +0 -12
- data/spec/app/models/ordered_post.rb +0 -6
- data/spec/app/models/ordered_preference.rb +0 -6
- data/spec/app/models/oscar.rb +0 -15
- data/spec/app/models/override.rb +0 -16
- data/spec/app/models/ownable.rb +0 -6
- data/spec/app/models/owner.rb +0 -6
- data/spec/app/models/pack.rb +0 -3
- data/spec/app/models/page.rb +0 -5
- data/spec/app/models/page_question.rb +0 -4
- data/spec/app/models/palette.rb +0 -7
- data/spec/app/models/paranoid_phone.rb +0 -25
- data/spec/app/models/paranoid_post.rb +0 -36
- data/spec/app/models/parent.rb +0 -5
- data/spec/app/models/parent_doc.rb +0 -6
- data/spec/app/models/passport.rb +0 -5
- data/spec/app/models/patient.rb +0 -9
- data/spec/app/models/pdf_writer.rb +0 -3
- data/spec/app/models/pencil.rb +0 -1
- data/spec/app/models/person.rb +0 -201
- data/spec/app/models/pet.rb +0 -23
- data/spec/app/models/pet_owner.rb +0 -6
- data/spec/app/models/phone.rb +0 -11
- data/spec/app/models/phone_observer.rb +0 -6
- data/spec/app/models/pizza.rb +0 -7
- data/spec/app/models/player.rb +0 -35
- data/spec/app/models/post.rb +0 -43
- data/spec/app/models/powerup.rb +0 -11
- data/spec/app/models/preference.rb +0 -9
- data/spec/app/models/princess.rb +0 -8
- data/spec/app/models/product.rb +0 -17
- data/spec/app/models/profile.rb +0 -5
- data/spec/app/models/pronunciation.rb +0 -5
- data/spec/app/models/purchase.rb +0 -4
- data/spec/app/models/question.rb +0 -8
- data/spec/app/models/quiz.rb +0 -10
- data/spec/app/models/rating.rb +0 -8
- data/spec/app/models/record.rb +0 -46
- data/spec/app/models/registry.rb +0 -4
- data/spec/app/models/role.rb +0 -7
- data/spec/app/models/root_category.rb +0 -4
- data/spec/app/models/sandwich.rb +0 -4
- data/spec/app/models/scheduler.rb +0 -7
- data/spec/app/models/seo.rb +0 -7
- data/spec/app/models/series.rb +0 -4
- data/spec/app/models/server.rb +0 -13
- data/spec/app/models/service.rb +0 -22
- data/spec/app/models/shape.rb +0 -12
- data/spec/app/models/shelf.rb +0 -5
- data/spec/app/models/shipping_container.rb +0 -5
- data/spec/app/models/shipping_pack.rb +0 -3
- data/spec/app/models/shop.rb +0 -6
- data/spec/app/models/short_agent.rb +0 -4
- data/spec/app/models/short_quiz.rb +0 -5
- data/spec/app/models/slave.rb +0 -6
- data/spec/app/models/song.rb +0 -8
- data/spec/app/models/square.rb +0 -4
- data/spec/app/models/strategy.rb +0 -3
- data/spec/app/models/sub_item.rb +0 -3
- data/spec/app/models/subscription.rb +0 -4
- data/spec/app/models/survey.rb +0 -5
- data/spec/app/models/symptom.rb +0 -6
- data/spec/app/models/tag.rb +0 -8
- data/spec/app/models/target.rb +0 -5
- data/spec/app/models/template.rb +0 -5
- data/spec/app/models/thing.rb +0 -9
- data/spec/app/models/title.rb +0 -4
- data/spec/app/models/tool.rb +0 -8
- data/spec/app/models/topping.rb +0 -5
- data/spec/app/models/track.rb +0 -38
- data/spec/app/models/translation.rb +0 -5
- data/spec/app/models/tree.rb +0 -9
- data/spec/app/models/truck.rb +0 -3
- data/spec/app/models/user.rb +0 -21
- data/spec/app/models/user_account.rb +0 -10
- data/spec/app/models/validation_callback.rb +0 -10
- data/spec/app/models/vehicle.rb +0 -11
- data/spec/app/models/version.rb +0 -5
- data/spec/app/models/vet_visit.rb +0 -5
- data/spec/app/models/video.rb +0 -17
- data/spec/app/models/video_game.rb +0 -1
- data/spec/app/models/weapon.rb +0 -11
- data/spec/app/models/wiki_page.rb +0 -17
- data/spec/app/models/word.rb +0 -12
- data/spec/app/models/word_origin.rb +0 -11
- data/spec/app/models/writer.rb +0 -11
- data/spec/mongoid/atomic/positionable_spec.rb +0 -227
- data/spec/mongoid/attributes/processing_spec.rb +0 -149
- data/spec/mongoid/callbacks_spec.rb +0 -1564
- data/spec/mongoid/components_spec.rb +0 -24
- data/spec/mongoid/contextual/find_and_modify_spec.rb +0 -220
- data/spec/mongoid/criterion/destructive_spec.rb +0 -101
- data/spec/mongoid/criterion/inspection_spec.rb +0 -27
- data/spec/mongoid/criterion/marshalable_spec.rb +0 -28
- data/spec/mongoid/criterion/modifiable_spec.rb +0 -409
- data/spec/mongoid/criterion/modification_spec.rb +0 -402
- data/spec/mongoid/criterion/scoping_spec.rb +0 -391
- data/spec/mongoid/dirty_spec.rb +0 -1508
- data/spec/mongoid/errors/eager_load_spec.rb +0 -29
- data/spec/mongoid/errors/mixed_session_configuration_spec.rb +0 -29
- data/spec/mongoid/errors/no_session_config_spec.rb +0 -29
- data/spec/mongoid/errors/no_session_database_spec.rb +0 -29
- data/spec/mongoid/errors/no_session_hosts_spec.rb +0 -29
- data/spec/mongoid/errors/no_sessions_config_spec.rb +0 -29
- data/spec/mongoid/errors/versioning_not_on_root_spec.rb +0 -29
- data/spec/mongoid/fields/internal/foreign_keys/array_spec.rb +0 -184
- data/spec/mongoid/fields/internal/foreign_keys/object_spec.rb +0 -201
- data/spec/mongoid/finders_spec.rb +0 -321
- data/spec/mongoid/hierarchy_spec.rb +0 -244
- data/spec/mongoid/identity_map_spec.rb +0 -564
- data/spec/mongoid/indexes_spec.rb +0 -404
- data/spec/mongoid/inspection_spec.rb +0 -57
- data/spec/mongoid/json_spec.rb +0 -33
- data/spec/mongoid/matchers/all_spec.rb +0 -31
- data/spec/mongoid/matchers/and_spec.rb +0 -162
- data/spec/mongoid/matchers/default_spec.rb +0 -130
- data/spec/mongoid/matchers/exists_spec.rb +0 -57
- data/spec/mongoid/matchers/gt_spec.rb +0 -74
- data/spec/mongoid/matchers/gte_spec.rb +0 -74
- data/spec/mongoid/matchers/in_spec.rb +0 -25
- data/spec/mongoid/matchers/lt_spec.rb +0 -74
- data/spec/mongoid/matchers/lte_spec.rb +0 -74
- data/spec/mongoid/matchers/ne_spec.rb +0 -25
- data/spec/mongoid/matchers/nin_spec.rb +0 -25
- data/spec/mongoid/matchers/or_spec.rb +0 -106
- data/spec/mongoid/matchers/size_spec.rb +0 -25
- data/spec/mongoid/matchers_spec.rb +0 -532
- data/spec/mongoid/multi_parameter_attributes_spec.rb +0 -128
- data/spec/mongoid/nested_attributes_spec.rb +0 -4945
- data/spec/mongoid/observer_spec.rb +0 -290
- data/spec/mongoid/paranoia_spec.rb +0 -759
- data/spec/mongoid/persistence/atomic/add_to_set_spec.rb +0 -262
- data/spec/mongoid/persistence/atomic/bit_spec.rb +0 -88
- data/spec/mongoid/persistence/atomic/inc_spec.rb +0 -133
- data/spec/mongoid/persistence/atomic/pop_spec.rb +0 -111
- data/spec/mongoid/persistence/atomic/pull_all_spec.rb +0 -77
- data/spec/mongoid/persistence/atomic/pull_spec.rb +0 -80
- data/spec/mongoid/persistence/atomic/push_all_spec.rb +0 -77
- data/spec/mongoid/persistence/atomic/push_spec.rb +0 -77
- data/spec/mongoid/persistence/atomic/rename_spec.rb +0 -42
- data/spec/mongoid/persistence/atomic/sets_spec.rb +0 -154
- data/spec/mongoid/persistence/atomic/unset_spec.rb +0 -65
- data/spec/mongoid/persistence/atomic_spec.rb +0 -216
- data/spec/mongoid/persistence/operations/embedded/insert_spec.rb +0 -191
- data/spec/mongoid/persistence/operations/embedded/remove_spec.rb +0 -8
- data/spec/mongoid/persistence/operations/insert_spec.rb +0 -149
- data/spec/mongoid/persistence/operations/remove_spec.rb +0 -113
- data/spec/mongoid/persistence/operations/update_spec.rb +0 -141
- data/spec/mongoid/persistence/operations/upsert_spec.rb +0 -59
- data/spec/mongoid/persistence/operations_spec.rb +0 -313
- data/spec/mongoid/persistence_spec.rb +0 -2279
- data/spec/mongoid/railties/document_spec.rb +0 -24
- data/spec/mongoid/relations/accessors_spec.rb +0 -844
- data/spec/mongoid/relations/auto_save_spec.rb +0 -261
- data/spec/mongoid/relations/bindings/embedded/in_spec.rb +0 -171
- data/spec/mongoid/relations/bindings/embedded/many_spec.rb +0 -54
- data/spec/mongoid/relations/bindings/embedded/one_spec.rb +0 -77
- data/spec/mongoid/relations/bindings/referenced/in_spec.rb +0 -241
- data/spec/mongoid/relations/bindings/referenced/many_spec.rb +0 -153
- data/spec/mongoid/relations/bindings/referenced/many_to_many_spec.rb +0 -178
- data/spec/mongoid/relations/bindings/referenced/one_spec.rb +0 -131
- data/spec/mongoid/relations/builders/embedded/in_spec.rb +0 -34
- data/spec/mongoid/relations/builders/embedded/many_spec.rb +0 -132
- data/spec/mongoid/relations/builders/embedded/one_spec.rb +0 -99
- data/spec/mongoid/relations/builders/nested_attributes/many_spec.rb +0 -234
- data/spec/mongoid/relations/builders/nested_attributes/one_spec.rb +0 -250
- data/spec/mongoid/relations/builders/referenced/in_spec.rb +0 -241
- data/spec/mongoid/relations/builders/referenced/many_spec.rb +0 -137
- data/spec/mongoid/relations/builders/referenced/many_to_many_spec.rb +0 -178
- data/spec/mongoid/relations/builders/referenced/one_spec.rb +0 -124
- data/spec/mongoid/relations/builders_spec.rb +0 -226
- data/spec/mongoid/relations/cascading/delete_spec.rb +0 -101
- data/spec/mongoid/relations/cascading/destroy_spec.rb +0 -47
- data/spec/mongoid/relations/cascading/nullify_spec.rb +0 -32
- data/spec/mongoid/relations/cascading/restrict_spec.rb +0 -68
- data/spec/mongoid/relations/cascading_spec.rb +0 -355
- data/spec/mongoid/relations/constraint_spec.rb +0 -74
- data/spec/mongoid/relations/conversions_spec.rb +0 -126
- data/spec/mongoid/relations/counter_cache_spec.rb +0 -205
- data/spec/mongoid/relations/cyclic_spec.rb +0 -156
- data/spec/mongoid/relations/embedded/dirty_spec.rb +0 -65
- data/spec/mongoid/relations/embedded/in_spec.rb +0 -580
- data/spec/mongoid/relations/embedded/many_spec.rb +0 -3841
- data/spec/mongoid/relations/embedded/one_spec.rb +0 -1055
- data/spec/mongoid/relations/macros_spec.rb +0 -625
- data/spec/mongoid/relations/metadata_spec.rb +0 -2030
- data/spec/mongoid/relations/options_spec.rb +0 -35
- data/spec/mongoid/relations/polymorphic_spec.rb +0 -132
- data/spec/mongoid/relations/referenced/in_spec.rb +0 -1501
- data/spec/mongoid/relations/referenced/many_spec.rb +0 -3632
- data/spec/mongoid/relations/referenced/many_to_many_spec.rb +0 -3561
- data/spec/mongoid/relations/referenced/one_spec.rb +0 -1331
- data/spec/mongoid/relations/reflections_spec.rb +0 -101
- data/spec/mongoid/relations/synchronization_spec.rb +0 -453
- data/spec/mongoid/relations/targets/enumerable_spec.rb +0 -1710
- data/spec/mongoid/relations_spec.rb +0 -188
- data/spec/mongoid/reloading_spec.rb +0 -305
- data/spec/mongoid/scoping_spec.rb +0 -978
- data/spec/mongoid/serialization_spec.rb +0 -833
- data/spec/mongoid/sessions/factory_spec.rb +0 -312
- data/spec/mongoid/sessions/mongo_uri_spec.rb +0 -103
- data/spec/mongoid/sessions_spec.rb +0 -1111
- data/spec/mongoid/sharding_spec.rb +0 -61
- data/spec/mongoid/state_spec.rb +0 -102
- data/spec/mongoid/unit_of_work_spec.rb +0 -196
- data/spec/mongoid/validations/associated_spec.rb +0 -183
- data/spec/mongoid/validations/format_spec.rb +0 -83
- data/spec/mongoid/validations/length_spec.rb +0 -223
- data/spec/mongoid/validations/numericality_spec.rb +0 -30
- data/spec/mongoid/validations/presence_spec.rb +0 -592
- data/spec/mongoid/validations/uniqueness_spec.rb +0 -2399
- data/spec/mongoid/validations_spec.rb +0 -309
- data/spec/mongoid/versioning_spec.rb +0 -540
- data/spec/rack/mongoid/middleware/identity_map_spec.rb +0 -72
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,611 @@
|
|
|
3
3
|
For instructions on upgrading to newer versions, visit
|
|
4
4
|
[mongoid.org](http://mongoid.org/en/mongoid/docs/upgrading.html).
|
|
5
5
|
|
|
6
|
+
### As of version 5.0.2, please refer to the github releases for change logs.
|
|
7
|
+
|
|
8
|
+
## 5.0.1
|
|
9
|
+
|
|
10
|
+
### Resolved Issues
|
|
11
|
+
|
|
12
|
+
* [MONGOID-3020](https://jira.mongodb.org/browse/MONGOID-3020) Test added to show it's no longer an issue.
|
|
13
|
+
* [MONGOID-3025](https://jira.mongodb.org/browse/MONGOID-3025) Test added to show it's no longer an issue.
|
|
14
|
+
* [MONGOID-3061](https://jira.mongodb.org/browse/MONGOID-3061) No longer an issue.
|
|
15
|
+
* [MONGOID-3073](https://jira.mongodb.org/browse/MONGOID-3073) Test added to show it's no longer an issue.
|
|
16
|
+
* [MONGOID-3085](https://jira.mongodb.org/browse/MONGOID-3085) Test added to show it's no longer an issue.
|
|
17
|
+
* [MONGOID-3101](https://jira.mongodb.org/browse/MONGOID-3101) No longer an issue.
|
|
18
|
+
* [MONGOID-3160](https://jira.mongodb.org/browse/MONGOID-3160) No longer an issue.
|
|
19
|
+
* [MONGOID-3176](https://jira.mongodb.org/browse/MONGOID-3176) No longer an issue.
|
|
20
|
+
* [MONGOID-3214](https://jira.mongodb.org/browse/MONGOID-3214) Test added to show it's no longer an issue.
|
|
21
|
+
* [MONGOID-3296](https://jira.mongodb.org/browse/MONGOID-3296) Add update callback for counter_cache.
|
|
22
|
+
* [MONGOID-3326](https://jira.mongodb.org/browse/MONGOID-3326) Test added to show it's no longer an issue.
|
|
23
|
+
* [MONGOID-3361](https://jira.mongodb.org/browse/MONGOID-3361) No longer an issue.
|
|
24
|
+
* [MONGOID-3365](https://jira.mongodb.org/browse/MONGOID-3365) Test added to show it's no longer an issue.
|
|
25
|
+
* [MONGOID-3402](https://jira.mongodb.org/browse/MONGOID-3402) Apply persistence options to parent.
|
|
26
|
+
* [MONGOID-3524](https://jira.mongodb.org/browse/MONGOID-3524) No longer an issue.
|
|
27
|
+
* [MONGOID-3529](https://jira.mongodb.org/browse/MONGOID-3529) Test exists already showing it's not an issue.
|
|
28
|
+
* [MONGOID-3543](https://jira.mongodb.org/browse/MONGOID-3543) Test exists already showing it's not an issue.
|
|
29
|
+
* [MONGOID-3611](https://jira.mongodb.org/browse/MONGOID-3611) Test added to show it's no longer an issue.
|
|
30
|
+
* [MONGOID-3650](https://jira.mongodb.org/browse/MONGOID-3650) No longer an issue.
|
|
31
|
+
* [MONGOID-3826](https://jira.mongodb.org/browse/MONGOID-3826), [MONGOID-4109](https://jira.mongodb.org/browse/MONGOID-4109) Fix Timelessness leaks.
|
|
32
|
+
* [MONGOID-3946](https://jira.mongodb.org/browse/MONGOID-3946) Test added to show it's no longer an issue.
|
|
33
|
+
* [MONGOID-3969](https://jira.mongodb.org/browse/MONGOID-3969) Test added to show it's no longer an issue.
|
|
34
|
+
* [MONGOID-3971](https://jira.mongodb.org/browse/MONGOID-3971) Not an issue.
|
|
35
|
+
* [MONGOID-3979](https://jira.mongodb.org/browse/MONGOID-3979) Not an issue, tests exist already.
|
|
36
|
+
* [MONGOID-3985](https://jira.mongodb.org/browse/MONGOID-3985) Not an issue.
|
|
37
|
+
* [MONGOID-4078](https://jira.mongodb.org/browse/MONGOID-4078) Behavior is intended.
|
|
38
|
+
* [MONGOID-4079](https://jira.mongodb.org/browse/MONGOID-4079) Not an issue.
|
|
39
|
+
* [MONGOID-4088](https://jira.mongodb.org/browse/MONGOID-4088) Account for sub-document dot notation with #pluck results.
|
|
40
|
+
* [MONGOID-4098](https://jira.mongodb.org/browse/MONGOID-4098) Fixed by a change to the Ruby driver. See RUBY-1029.
|
|
41
|
+
* [MONGOID-4101](https://jira.mongodb.org/browse/MONGOID-4101) Not an issue.
|
|
42
|
+
* [MONGOID-4106](https://jira.mongodb.org/browse/MONGOID-4106) Not an issue.
|
|
43
|
+
* [MONGOID-4110](https://jira.mongodb.org/browse/MONGOID-4110) Not an issue.
|
|
44
|
+
* [MONGOID-4119](https://jira.mongodb.org/browse/MONGOID-4119) Ensure that criteria selector becomes pipeline operator value.
|
|
45
|
+
* [MONGOID-4121](https://jira.mongodb.org/browse/MONGOID-4121) Not an issue.
|
|
46
|
+
* [MONGOID-4123](https://jira.mongodb.org/browse/MONGOID-4123) Fixed as a result of MONGOID-4159.
|
|
47
|
+
* [MONGOID-4125](https://jira.mongodb.org/browse/MONGOID-4125) Make sure none scopes referenced in procs are applied.
|
|
48
|
+
* [MONGOID-4132](https://jira.mongodb.org/browse/MONGOID-4132) Not an issue.
|
|
49
|
+
* [MONGOID-4157](https://jira.mongodb.org/browse/MONGOID-4157) Fixed by version 2.1.2 of the Ruby driver.
|
|
50
|
+
* [MONGOID-4162](https://jira.mongodb.org/browse/MONGOID-4162) Adapt index option mappings to new driver. (@Nielsomat)
|
|
51
|
+
* [MONGOID-3737](https://jira.mongodb.org/browse/MONGOID-3737) Test added to show it's no longer an issue.
|
|
52
|
+
* [MONGOID-3621](https://jira.mongodb.org/browse/MONGOID-3621) Not an issue.
|
|
53
|
+
* [MONGOID-3551](https://jira.mongodb.org/browse/MONGOID-3551) Not an issue.
|
|
54
|
+
* [MONGOID-3696](https://jira.mongodb.org/browse/MONGOID-3696) Test added to show it's no longer an issue.
|
|
55
|
+
* [MONGOID-3858](https://jira.mongodb.org/browse/MONGOID-3858) Test added to show it's no longer an issue.
|
|
56
|
+
* [MONGOID-3672](https://jira.mongodb.org/browse/MONGOID-3672) Not an issue.
|
|
57
|
+
* [MONGOID-4172](https://jira.mongodb.org/browse/MONGOID-4172) Use positional operator only on 1 level deep nesting.
|
|
58
|
+
* Added public cert to repo and sign gem if private key is present
|
|
59
|
+
|
|
60
|
+
## 5.0.0
|
|
61
|
+
|
|
62
|
+
### Major Changes (Backwards Incompatible)
|
|
63
|
+
|
|
64
|
+
* Mongoid now uses the official Mongo Ruby Driver 2.x instead of Moped.
|
|
65
|
+
|
|
66
|
+
* Most driver specific configuration options have changed, please see [here](http://docs.mongodb.org/ecosystem/tutorial/ruby-driver-tutorial/#ruby-options) for the new options.
|
|
67
|
+
|
|
68
|
+
* All references to `session` are now replaced with `client`. This includes the mongoid.yml configuration, `store_in` options, and all exceptions and modules with `Session` in the name.
|
|
69
|
+
|
|
70
|
+
* `find_and_modify` has been removed and replaced with 3 options: `find_one_and_update`, `find_one_and_delete` and `find_one_and_replace`.
|
|
71
|
+
|
|
72
|
+
* `text_search` has been removed as it is now a `$text` option in a query from 2.6 on.
|
|
73
|
+
|
|
74
|
+
* Mongoid no longer supports MongoDB 2.2 - support is now for only 2.4 and higher.
|
|
75
|
+
|
|
76
|
+
* \#3768 `first` and `last` no longer add an `_id` sort when no sorting options have been provided. In order to guarantee that a document is the first or last, it needs to now contain an explicit sort.
|
|
77
|
+
|
|
78
|
+
* `Document#deleted?` alias has been removed, please continue to use `Document#destroyed?`.
|
|
79
|
+
|
|
80
|
+
### New Features
|
|
81
|
+
|
|
82
|
+
* \#4016 Allow private and protected setters on fields for atomic operations. (Rob Smith)
|
|
83
|
+
|
|
84
|
+
* \#3985 Return nil when using `{upsert: true}` in `find_and_modify` (Adrien Siami)
|
|
85
|
+
|
|
86
|
+
* \#3963 Allow extended JSON object ids to be passed to `find`.
|
|
87
|
+
|
|
88
|
+
* \#3846 Allow #pluck when none is used in criteria. (Braulio Martinez)
|
|
89
|
+
|
|
90
|
+
### Resolved Issues
|
|
91
|
+
|
|
92
|
+
* \#4091 Use subclass context when calling a scope defined in a superclass. (Edgars Beigarts)
|
|
93
|
+
|
|
94
|
+
* \#4075 Made remove index logging specific to each index that was actually getting removed.
|
|
95
|
+
|
|
96
|
+
* \#4071 Fixed loading of enumerable relation to check the added documents when iterating.
|
|
97
|
+
|
|
98
|
+
* \#4077 Many relations now include Enumerable.
|
|
99
|
+
|
|
100
|
+
* \#4052 Fixed uniqueness validation on localized fields with no value.
|
|
101
|
+
|
|
102
|
+
* \#4033 Removed all uses of the $ positional operator in atomic updates.
|
|
103
|
+
|
|
104
|
+
* \#4030 Dup/clone exceptions auto-include dynamic attributes.
|
|
105
|
+
|
|
106
|
+
* \#4005 Fixed inclusion of mongoid with Rails components that don't have the Rails environment.
|
|
107
|
+
|
|
108
|
+
* \#3993 Fixes issue where `dup`/`clone` fails for embedded documents that use store_as without using Mongoid::Atributes::Dynamic
|
|
109
|
+
|
|
110
|
+
* \#3991 Fixed embedded documents not flagging as changed after calling #changed? and modifying the
|
|
111
|
+
child elements.
|
|
112
|
+
|
|
113
|
+
* \#3874 Adding snapshot option to context.
|
|
114
|
+
|
|
115
|
+
* \#3868 Loading models in rake tasks now expands the rails path.
|
|
116
|
+
|
|
117
|
+
* \#3764 Fixed case statement check for enumerable targets.
|
|
118
|
+
|
|
119
|
+
* \#3740 Fixes `Missing attribute: '_id'` error when using methods only or without (dx7)
|
|
120
|
+
|
|
121
|
+
* \#3631 Fixes issue where `before_save` callback can get called twice after a child create
|
|
122
|
+
|
|
123
|
+
* \#3599 Fixed application of default scopes from superclass in subclasses.
|
|
124
|
+
|
|
125
|
+
* \#3104 Fixed enumerable targets to check first/last in proper order.
|
|
126
|
+
|
|
127
|
+
## 4.0.2
|
|
128
|
+
|
|
129
|
+
### New Features
|
|
130
|
+
|
|
131
|
+
* \#3931 Add #find_or_create_by! method to many associations. (Tom Beynon)
|
|
132
|
+
|
|
133
|
+
* \#3731 Add find_by! method. (Guillermo Iguaran)
|
|
134
|
+
|
|
135
|
+
### Resolved Issues
|
|
136
|
+
|
|
137
|
+
* \#3722 Use the right database name when combining #store_in and #with. (Arthur Neves)
|
|
138
|
+
|
|
139
|
+
* \#3934 Dont apply sort when doing a find_by. (Arthur Neves)
|
|
140
|
+
|
|
141
|
+
* \#3935 fix multiple fields sorting on contextual memory. (chamnap)
|
|
142
|
+
|
|
143
|
+
* \#3904 BSON::Document#symbolize_keys should return keys as symbols. (Arthur Neves)
|
|
144
|
+
|
|
145
|
+
* \#3948 Fix remove_undefined_indexes on rails 4.2, to symbolize right the Document keys. (Adam Wróbel)
|
|
146
|
+
|
|
147
|
+
* \#3626 Document#to_key, needs to return a ObjectId as String so we can query back using that id. (Arthur Neves)
|
|
148
|
+
|
|
149
|
+
* \#3888 raise UnknownAttributeError when 'set' is called on non existing field and Mongoid::Attributes::Dynamic is not included in model. (Shweta Kale)
|
|
150
|
+
|
|
151
|
+
* \#3889 'set' will allow to set value of non existing field when Mongoid::Attributes::Dynamic is included in model. (Shweta Kale)
|
|
152
|
+
|
|
153
|
+
* \#3812 Fixed validation context when saving (Yaroslav Zemlyanuhin)
|
|
154
|
+
|
|
155
|
+
## 4.0.1
|
|
156
|
+
|
|
157
|
+
### Resolved Issues
|
|
158
|
+
|
|
159
|
+
* \#3911 Fix relations named "parent". (nkriege)
|
|
160
|
+
|
|
161
|
+
* \#3792/\#3881 Fix many internal calls to #_id instead of #id to avoid issues
|
|
162
|
+
when overloading #id (Gauthier Delacroix)
|
|
163
|
+
|
|
164
|
+
* \#3847 Fix 'QueryCache#get_more' result, when collection has more documents than first query batch. (Angelica Korsun)
|
|
165
|
+
|
|
166
|
+
* \#3684 Dont raise MissingAttributeError, when using a only() scope. (Arthur Neves)
|
|
167
|
+
|
|
168
|
+
* \#3703 pluck method should not compact the values. (Arthur Neves)
|
|
169
|
+
|
|
170
|
+
* \#3773 Use nanoseconds for cache_key timestamp instead of plain seconds. (Máximo Mussini)
|
|
171
|
+
|
|
172
|
+
## 4.0.0
|
|
173
|
+
|
|
174
|
+
### Major Changes (Backwards Incompatible)
|
|
175
|
+
|
|
176
|
+
* \#3320 Remove Rails dependencies on database rake tasks. (Arthur Neves)
|
|
177
|
+
|
|
178
|
+
All db:* rake tasks should work as before when using Rails.
|
|
179
|
+
When not in a Rails, just load the database tasks using:
|
|
180
|
+
|
|
181
|
+
load 'mongoid/tasks/database.rake'
|
|
182
|
+
|
|
183
|
+
* Mongoid 4 now only supports MongoDB 2.4.0 and higher.
|
|
184
|
+
|
|
185
|
+
* `Document#metadata` has been renamed to `Document#relation_metadata` to
|
|
186
|
+
avoid common conflicts. Relation proxies also have this renamed to the
|
|
187
|
+
same as well.
|
|
188
|
+
|
|
189
|
+
* Scopes and default scopes must now all be defined within lambdas or procs.
|
|
190
|
+
|
|
191
|
+
* `skip_version_check` config option was removed.
|
|
192
|
+
|
|
193
|
+
* IdentityMap removed. (Arthur Neves)
|
|
194
|
+
|
|
195
|
+
* Eager load rework. Eager load now doesnt need the identity map to load
|
|
196
|
+
related documents. A set of preloaders can eager load the associations
|
|
197
|
+
passed to .includes method. (Arthur Neves)
|
|
198
|
+
|
|
199
|
+
* Mongoid now supports the new read preferences that the core drivers
|
|
200
|
+
provide. These include:
|
|
201
|
+
|
|
202
|
+
- `:primary`: Will always read from a primary node. (default)
|
|
203
|
+
- `:primary_preferred`: Attempt a primary first, then secondary if none available.
|
|
204
|
+
- `:secondary`: Will always read from a secondary node.
|
|
205
|
+
- `:secondary_preferred`: Attempt a secondary first, then primary if none available.
|
|
206
|
+
- `:nearest`: Attempt to read from the node with the lowest latency.
|
|
207
|
+
|
|
208
|
+
Sample syntax:
|
|
209
|
+
|
|
210
|
+
Person.with(read: :secondary).first
|
|
211
|
+
|
|
212
|
+
The `:consistency` option is no longer valid, use the `:read` option now.
|
|
213
|
+
|
|
214
|
+
* Mongoid now defaults all writes to propagate (formerly "safe mode") and now
|
|
215
|
+
has different propagate semantics:
|
|
216
|
+
|
|
217
|
+
- `{ w: -1 }`: Don't verify writes and raise no network errors.
|
|
218
|
+
- `{ w: 0 }`: Don't verify writes and raise network errors.
|
|
219
|
+
- `{ w: 1 }`: Verify writes on the primary node. (default)
|
|
220
|
+
- `{ w: n }`: Verify writes on n number of nodes.
|
|
221
|
+
- `{ w: "majority" }`: Verify writes on a majority of nodes.
|
|
222
|
+
|
|
223
|
+
Sample syntax:
|
|
224
|
+
|
|
225
|
+
Person.with(write: {w: :majority}).create!(name: "John")
|
|
226
|
+
|
|
227
|
+
The `:safe` option is no longer valid use the `:write` option now.
|
|
228
|
+
|
|
229
|
+
* \#3230 Array and Hash fields now validate that the correct types are
|
|
230
|
+
getting set, instead of allowing any value. (Rodrigo Saito)
|
|
231
|
+
|
|
232
|
+
* \#3043/\#2949 Rework on the internals of persistence options. (Arthur Neves)
|
|
233
|
+
|
|
234
|
+
* Mongoid now requires Active Model 4 or higher.
|
|
235
|
+
|
|
236
|
+
* `Document#set` now accepts multiple attributes in the form of a hash,
|
|
237
|
+
instead of the previous `(field, value)` args. Field aliases and typecasting
|
|
238
|
+
are also now supported in this operation.
|
|
239
|
+
|
|
240
|
+
document.set(name: "Photek", likes: 10000)
|
|
241
|
+
|
|
242
|
+
* `Document#rename` now accepts multiple attributes in the form of a hash,
|
|
243
|
+
instead of the previous `(field, value)` args. Field aliases are supported.
|
|
244
|
+
|
|
245
|
+
document.rename(first_name: "fn", last_name: "ln")
|
|
246
|
+
|
|
247
|
+
* `Document#inc` now accepts multiple attributes in the form of a hash, instead
|
|
248
|
+
of previously only being able to increment one value at a time. Aliases and
|
|
249
|
+
serialization is supported.
|
|
250
|
+
|
|
251
|
+
document.inc(score: 10, place: -1, lives: -10)
|
|
252
|
+
|
|
253
|
+
* `Document#pop` now accepts multiple attributes in the form of a hash, instead
|
|
254
|
+
of previously only being able to pop one value at a time. Aliases and
|
|
255
|
+
serialization is supported.
|
|
256
|
+
|
|
257
|
+
document.pop(names: 1, aliases: -1)
|
|
258
|
+
|
|
259
|
+
* `Document#bit` now accepts multiple attributes in the form of a hash, instead
|
|
260
|
+
of previously only being able to apply one set of operations at a time.
|
|
261
|
+
Aliases and serialization are supported.
|
|
262
|
+
|
|
263
|
+
document.bit(age: { and: 13 }, score: { or: 13 })
|
|
264
|
+
|
|
265
|
+
* `Document#pull` now accepts multiple attributes in the form of a hash, instead
|
|
266
|
+
of previously only being able to pull one value at a time. Aliases and
|
|
267
|
+
serialization is supported.
|
|
268
|
+
|
|
269
|
+
document.pull(names: "James", aliases: "007")
|
|
270
|
+
|
|
271
|
+
* `Document#pull_all` now accepts multiple attributes in the form of a hash,
|
|
272
|
+
instead of previously only being able to pull one value at a time. Aliases and
|
|
273
|
+
serialization is supported.
|
|
274
|
+
|
|
275
|
+
document.pull_all(names: ["James", "Bond"], aliases: ["007"])
|
|
276
|
+
|
|
277
|
+
* `Document#push_all` has been removed since it was deprecated in MongoDB 2.4.
|
|
278
|
+
Use `Document.push` instead.
|
|
279
|
+
|
|
280
|
+
* `Document#push` now accepts multiple attributes in the form of a hash, and
|
|
281
|
+
can handle the pushing of single values or multiple values to the field via
|
|
282
|
+
$push with $each. Aliases and serialization is supported.
|
|
283
|
+
|
|
284
|
+
document.push(names: "James", aliases: [ "007", "Jim" ])
|
|
285
|
+
|
|
286
|
+
* `Document#add_to_set` now accepts multiple attributes in the form of a hash,
|
|
287
|
+
and now aliases and serialization are supported.
|
|
288
|
+
|
|
289
|
+
document.add_to_set(names: "James", aliases: "007")
|
|
290
|
+
|
|
291
|
+
* Criteria atomic operations API is now changed to match the changes in the
|
|
292
|
+
single document atomic API, for example:
|
|
293
|
+
|
|
294
|
+
Band.where(name: "Depeche Mode").inc(likes: 10, followers: 20)
|
|
295
|
+
|
|
296
|
+
* \#3399 #create and #create! on relations can now take an array of attributes as
|
|
297
|
+
the first parameter to create multiple documents at once.
|
|
298
|
+
|
|
299
|
+
person.addresses.create([{ street: "Bond" }, { street: "Upper" }])
|
|
300
|
+
person.addresses.create!([{ street: "Bond" }, { street: "Upper" }])
|
|
301
|
+
|
|
302
|
+
* \#3141 `rake db:test:prepare` now sets up all defined indexes if Mongoid is the
|
|
303
|
+
only ODM/ORM in the environment.
|
|
304
|
+
|
|
305
|
+
* \#3138 `update_attributes` can now be accessed simply by calling `update`.
|
|
306
|
+
|
|
307
|
+
* \#3083 A new rake task: `rake db:mongoid:remove_undefined_indexes` has been added to
|
|
308
|
+
remove indexes from the database that are not explicitly defined in the models.
|
|
309
|
+
(Aidan Feldman)
|
|
310
|
+
|
|
311
|
+
* \#3029 The `relation_field` field that is added for a single use case with polymorphic
|
|
312
|
+
relations has been removed. So where the following would work before:
|
|
313
|
+
|
|
314
|
+
class Eye
|
|
315
|
+
include Mongoid::Document
|
|
316
|
+
belongs_to :eyeable, polymorphic: true
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
class Face
|
|
320
|
+
include Mongoid::Document
|
|
321
|
+
has_one :left_eye, class_name: "Eye", as: :eyeable
|
|
322
|
+
has_one :right_eye, class_name: "Eye", as: :eyeable
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
This would now need to be modeled as (with the appropriate migration):
|
|
326
|
+
|
|
327
|
+
class Eye
|
|
328
|
+
include Mongoid::Document
|
|
329
|
+
belongs_to :left_socket, class_name: "Face", inverse_of: :left_eye
|
|
330
|
+
belongs_to :right_socket, class_name: "Face", inverse_of: :right_eye
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
class Face
|
|
334
|
+
include Mongoid::Document
|
|
335
|
+
has_one :left_eye, class_name: "Eye", inverse_of: :left_socket
|
|
336
|
+
has_one :right_eye, class_name: "Eye", inverse_of: :right_socket
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
* \#3075 `update_attribute` now properly calls the setter method instead of
|
|
340
|
+
using `write_attribute`.
|
|
341
|
+
|
|
342
|
+
* \#3060 Allow atomically blocks to allow multiple calls of the same type.
|
|
343
|
+
(Brian Norton)
|
|
344
|
+
|
|
345
|
+
* \#3037 Model indexes are no longer stored in an `index_options` hash on the
|
|
346
|
+
model class. Instead, an array named `index_specifications` now exists on the
|
|
347
|
+
class which contains a list of `Indexable::Specification` objects. This is so
|
|
348
|
+
we could properly handle the case of indexes with the same keys but different
|
|
349
|
+
order.
|
|
350
|
+
|
|
351
|
+
* \#2956 Caching on queries now only happens when `cache` is specifically
|
|
352
|
+
called. (Arthur Neves)
|
|
353
|
+
|
|
354
|
+
* \#2659 `Mongoid::Railtie` now properly uses only one initializer and
|
|
355
|
+
the name has changed to `mongoid.load-config`.
|
|
356
|
+
|
|
357
|
+
* \#2656 `rake db:reseed` is now `rake db:reset` (Arthur Neves)
|
|
358
|
+
|
|
359
|
+
* \#2648 `Boolean` becomes `Mongoid::Boolean` to avoid polluting the global
|
|
360
|
+
namespace with a commonly used class by other libraries.
|
|
361
|
+
|
|
362
|
+
* \#2603 Return values from setters are now always the set value, regardless
|
|
363
|
+
of calling the setter or using send.
|
|
364
|
+
|
|
365
|
+
* \#2597 `Mongoid::Observer` was removed in line with Rails 4.
|
|
366
|
+
|
|
367
|
+
* \#2563 The `allow_dynamic_fields` configuration option has been removed as
|
|
368
|
+
dynamic fields are now allowed on a per-model level. In order to allow a
|
|
369
|
+
model to use dynamic fields, simply include the module in each.
|
|
370
|
+
(Josh Martin)
|
|
371
|
+
|
|
372
|
+
class Band
|
|
373
|
+
include Mongoid::Document
|
|
374
|
+
include Mongoid::Attributes::Dynamic
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
* \#2497 Calling `to_json` no longer tampers with the return value from the
|
|
378
|
+
driver, and proper returns `{ "$oid" : object_id.to_s }` instead of just
|
|
379
|
+
the string representation previously.
|
|
380
|
+
|
|
381
|
+
* \#2433 `Mongoid::Paranoia` has been removed.
|
|
382
|
+
|
|
383
|
+
* \#2432 `Mongoid::Versioning` has been removed.
|
|
384
|
+
|
|
385
|
+
* \#2218 Creating or instantiating documents that have default scopes will now
|
|
386
|
+
apply the default scope to the document, if the scope is not complex.
|
|
387
|
+
|
|
388
|
+
* \#2200 Mass assignment security now mirrors Rails 4's behavior.
|
|
389
|
+
`without_protection` option was also removed.
|
|
390
|
+
`attr_accessible` class method was removed.
|
|
391
|
+
Mongoid and Strong parameters should work fine for mass assignment protection.
|
|
392
|
+
|
|
393
|
+
* `delete_all` and `destroy_all` no longer take a `:conditions` hash but
|
|
394
|
+
just the raw attributes.
|
|
395
|
+
|
|
396
|
+
* \#1908 Documents now loaded from criteria using `#only` or `#without` will now
|
|
397
|
+
raise an error when attempting to save, update, or delete these records.
|
|
398
|
+
Additionally fields excluded from the fields retrieved from the database will
|
|
399
|
+
also raise an exception when trying to access them.
|
|
400
|
+
|
|
401
|
+
* \#1344 Atomic updates can now be executed in an `atomically` block, which will
|
|
402
|
+
delay any atomic updates on the document the block was called on until the
|
|
403
|
+
block is complete.
|
|
404
|
+
|
|
405
|
+
Update calls can be executed as normal in the block:
|
|
406
|
+
|
|
407
|
+
document.atomically do
|
|
408
|
+
document.inc(likes: 10)
|
|
409
|
+
document.bit(members: { and: 10 })
|
|
410
|
+
document.set(name: "Photek")
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
The document is also yielded to the block:
|
|
414
|
+
|
|
415
|
+
document.atomically do |doc|
|
|
416
|
+
doc.inc(likes: 10)
|
|
417
|
+
doc.bit(members: { and: 10 })
|
|
418
|
+
doc.set(name: "Photek")
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
The atomic commands are have a fluid interface:
|
|
422
|
+
|
|
423
|
+
document.atomically do |doc|
|
|
424
|
+
doc.inc(likes: 10).bit(members: { and: 10 }).set(name: "Photek")
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
If the fluid interface is leveraged without the `atomically` block, the
|
|
428
|
+
operations will persist in individual calls. For example, the following
|
|
429
|
+
would hit the database 3 times without the block provided:
|
|
430
|
+
|
|
431
|
+
doc.inc(likes: 10).bit(members: { and: 10 }).set(name: "Photek")
|
|
432
|
+
|
|
433
|
+
The block is only good for 1 document at a time, so embedded and root
|
|
434
|
+
document updates cannot be mixed at this time.
|
|
435
|
+
|
|
436
|
+
### New Features
|
|
437
|
+
|
|
438
|
+
* Mongoid now uses ActiveSupport::LogSubscriber to subscribe logs, and
|
|
439
|
+
ActiveSupport::Notifications to send operation logs. (Arthur Neves)
|
|
440
|
+
Example of log subscription:
|
|
441
|
+
|
|
442
|
+
ActiveSupport::Notifications.subscribe('query.moped') do |event|
|
|
443
|
+
..
|
|
444
|
+
end
|
|
445
|
+
|
|
446
|
+
* Field types can now use symbols as well as class names. See:
|
|
447
|
+
https://github.com/mongoid/mongoid/blob/master/lib/mongoid/fields.rb#L16
|
|
448
|
+
for the available mappings.
|
|
449
|
+
|
|
450
|
+
* \#3580 Fields can now be reset to their default values, with the methods:
|
|
451
|
+
|
|
452
|
+
document.reset_name_to_default!
|
|
453
|
+
|
|
454
|
+
* \#3513 Documents now have a `#destroy!` method that will raise a
|
|
455
|
+
`Mongoid::Errors::DocumentNotDestroyed` error if a destroy callback returns
|
|
456
|
+
a false value.
|
|
457
|
+
|
|
458
|
+
* \#3496 Added class level and criteria level `find_or_create_by!`.
|
|
459
|
+
|
|
460
|
+
* \#3479 Map/reduce now respects criteria no timeout options if output is not
|
|
461
|
+
inline.
|
|
462
|
+
|
|
463
|
+
* \#3478 Criteria objects now have a #none method that will cause the criteria to
|
|
464
|
+
never hit the database and always have zero documents.
|
|
465
|
+
|
|
466
|
+
Band.none
|
|
467
|
+
Band.none.where(name: "Tool") # Always has zero documents.
|
|
468
|
+
|
|
469
|
+
* \#3410 Mongoid now has a query cache that can be used as a middleware in
|
|
470
|
+
Rack applications. (Arthur Neves)
|
|
471
|
+
|
|
472
|
+
For Rails:
|
|
473
|
+
|
|
474
|
+
config.middleware.use(Mongoid::QueryCache::Middleware)
|
|
475
|
+
|
|
476
|
+
* \#3319 Counters can now be reset from a document instance:
|
|
477
|
+
|
|
478
|
+
document.reset_counters(:relation)
|
|
479
|
+
|
|
480
|
+
* \#3310 embedded_in relations now accept a `touch` option to update parents.
|
|
481
|
+
|
|
482
|
+
* \#3302 Aliasing using `alias_attribute` now properly handles aliases in criteria.
|
|
483
|
+
|
|
484
|
+
* \#3155 Range field will persist the exclude_end when provided.
|
|
485
|
+
(Daniel Libanori)
|
|
486
|
+
|
|
487
|
+
* \#3146 Adding :overwrite field option, when it`s true, it wont check duplicates.
|
|
488
|
+
(Daniel Libanori)
|
|
489
|
+
|
|
490
|
+
* \#3002 Reloading the Rails console will also now clear Mongoid's identity map.
|
|
491
|
+
|
|
492
|
+
* \#2938 A configuration option `duplicate_fields_exception` has been added that
|
|
493
|
+
when set to `true` will raise an exception when defining a field that will
|
|
494
|
+
override an existing method. (Arthur Neves)
|
|
495
|
+
|
|
496
|
+
* \#2924 MongoDB 2.4 beta text search now has a DSL provided by Mongoid. Like
|
|
497
|
+
other queries, text searches are lazy evaluated, and available off the class
|
|
498
|
+
or criteria level.
|
|
499
|
+
|
|
500
|
+
Note that any 3rd party gem that provides a `text_search` method will now no
|
|
501
|
+
longer work with Mongoid, and will need to change its syntax. Examples:
|
|
502
|
+
|
|
503
|
+
Band.text_search("mode").project(name: 1).each do |doc|
|
|
504
|
+
# ...
|
|
505
|
+
end
|
|
506
|
+
|
|
507
|
+
Band.limit(10).text_search("phase").language("latin")
|
|
508
|
+
Band.where(:likes.gt => 1000).text_search("lucy")
|
|
509
|
+
|
|
510
|
+
* \#2855 Multiple extensions can now be supplied to relations. (Daniel Libanori)
|
|
511
|
+
|
|
512
|
+
### Resolved Issues
|
|
513
|
+
|
|
514
|
+
* \#3676 Make pluck work with embedded associations
|
|
515
|
+
(Arthur Neves)
|
|
516
|
+
|
|
517
|
+
* \#2898 Dirty attribute methods now properly handle field aliases.
|
|
518
|
+
(Niels Ganser)
|
|
519
|
+
|
|
520
|
+
* \#3620 Add ActiveModel module instance methods to prohibited_methods list.
|
|
521
|
+
(Arthur Neves)
|
|
522
|
+
|
|
523
|
+
* \#3610 Don't allow atomic operations on read-only attributes
|
|
524
|
+
(Frederico Araujo)
|
|
525
|
+
|
|
526
|
+
* \#3619 Don't validate documents that are flagged for destruction.
|
|
527
|
+
(Christopher J. Bottaro)
|
|
528
|
+
|
|
529
|
+
* \#3617 Don't skip index creation on cyclic documents. (shaiker)
|
|
530
|
+
|
|
531
|
+
* \#3568 Fixed missing attributes error on present localized fields.
|
|
532
|
+
|
|
533
|
+
* \#3514 Fixed query cache to work on first/last calls.
|
|
534
|
+
|
|
535
|
+
* \#3383/\#3495 Fix has_and_belongs_to_many eager load. (Arthur Neves)
|
|
536
|
+
|
|
537
|
+
* \#3492 $rename operations should not mongoize values. (Vladislav Melanitskiy)
|
|
538
|
+
|
|
539
|
+
* \#3490 Allow localized fields to work with boolean `false` values.
|
|
540
|
+
|
|
541
|
+
* \#3487 Map Boolean to Mongoid::Boolean in field definitions. (Arthur Neves)
|
|
542
|
+
|
|
543
|
+
* \#3449 Touch needs to work for create and update. (Greggory Rothmeier)
|
|
544
|
+
|
|
545
|
+
* \#3347 Creating documents off of scopes for embedded relations now properly
|
|
546
|
+
sets the parent document on the created children.
|
|
547
|
+
|
|
548
|
+
* \#3432 Fixed mongoization of DateTime losing precision.
|
|
549
|
+
|
|
550
|
+
* \#3397 Fixed $ne matcher for embedded documents to match server behavior.
|
|
551
|
+
|
|
552
|
+
* \#3352 Allow named scopes named "open" to work through 1-n relations.
|
|
553
|
+
|
|
554
|
+
* \#3348 Fixing compounded indexes having the same keys with
|
|
555
|
+
different directions. (Arthur Neves)
|
|
556
|
+
|
|
557
|
+
* \#2701 Fixing extra query on belongs_to binding. (Arthur Neves)
|
|
558
|
+
|
|
559
|
+
* \#3089 Allow demongoization of strings to floats (Daniel Libanori)
|
|
560
|
+
|
|
561
|
+
* \#3278 Counter cache should update the document in memory too. (Arthur Neves)
|
|
562
|
+
|
|
563
|
+
* \#3242 Has_many relation must use the inverse foreign_key. (Arthur Neves)
|
|
564
|
+
|
|
565
|
+
* \#3233 Don't double call validation callbacks when cascading children and
|
|
566
|
+
relation validation is turned on.
|
|
567
|
+
|
|
568
|
+
* \#3197 Improvements in the calls to `aggregates` on root and embedded
|
|
569
|
+
collections. (Wojciech Piekutowski)
|
|
570
|
+
|
|
571
|
+
* \#3144/\#3219 Fixing name collision on @_children ivar. (Arthur Neves)
|
|
572
|
+
|
|
573
|
+
* \#3088 Range field can accept a hash, which could be the attribute from the db.
|
|
574
|
+
(Daniel Libanori)
|
|
575
|
+
|
|
576
|
+
* \#3116 Relations instance variables are now all prefixed with `_`.
|
|
577
|
+
|
|
578
|
+
* \#3093 Only flatten 1 level when atomically pushing arrays.
|
|
579
|
+
|
|
580
|
+
* \#3063 `Document#becomes` now properly sets base object on errors.
|
|
581
|
+
(Adam Ross Cohen)
|
|
582
|
+
|
|
583
|
+
* \#3019 Atomic operations will no longer attempt to persist if the document
|
|
584
|
+
is not persisted.
|
|
585
|
+
|
|
586
|
+
* \#2903 Removed unused string `to_a` extension.
|
|
587
|
+
|
|
588
|
+
## 3.1.7
|
|
589
|
+
|
|
590
|
+
### Resolved Issues
|
|
591
|
+
|
|
592
|
+
* \#3465 Fixed ambiguous relation errors where inverse_of is set to nil.
|
|
593
|
+
|
|
594
|
+
* \#3414 Backport skip and limit options on aggregation. (Wojciech Piekutowski)
|
|
595
|
+
|
|
596
|
+
* \#3469 Fix RegexpError: failed to allocate memory: /\./ on .hash_dot_syntax? (Dmitry Krasnoukhov)
|
|
597
|
+
|
|
598
|
+
## 3.1.6
|
|
599
|
+
|
|
600
|
+
### Resolved Issues
|
|
601
|
+
|
|
602
|
+
* \#3337 Ensure localized fields map is cloned with inheritance.
|
|
603
|
+
|
|
604
|
+
* \#3262 Fixed atomic array operations on HABTM foreign key fields from turning
|
|
605
|
+
single elements into arrays.
|
|
606
|
+
|
|
607
|
+
* \#3282 Fixed .timeless option to use a thread local instead of a class attribute.
|
|
608
|
+
Also remove the timeless methods from all docs, and only add to timestamps docs.
|
|
609
|
+
(Arthur Neves)
|
|
610
|
+
|
|
6
611
|
## 3.1.5
|
|
7
612
|
|
|
8
613
|
### Resolved Issues
|
|
@@ -23,7 +628,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
23
628
|
|
|
24
629
|
* \#3137 Allow multiple `belongs_to` sets in a row with ids.
|
|
25
630
|
|
|
26
|
-
* \#3079
|
|
631
|
+
* \#3079 Embedded docs with paranoia parents were losing the _id when
|
|
27
632
|
reloading from db, as they didnt have the right persisted? value. (Arthur Neves)
|
|
28
633
|
|
|
29
634
|
* \#3081 Criteria's `method_missing` now checks if an array responds to the provided
|
|
@@ -78,6 +683,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
78
683
|
### Resolved Issues
|
|
79
684
|
|
|
80
685
|
* Dont duplicate embedded documents when saving after calling becomes method.
|
|
686
|
+
(Arthur Neves)
|
|
81
687
|
|
|
82
688
|
* \#2961 Reloading a mongoid.yml configuration now properly clears previously
|
|
83
689
|
configured sessions.
|
|
@@ -88,11 +694,6 @@ For instructions on upgrading to newer versions, visit
|
|
|
88
694
|
* \#2921 Don't use type in identity map selection if inheritance is not
|
|
89
695
|
in play. (Arthur Neves)
|
|
90
696
|
|
|
91
|
-
* \#2899 Dirty attribute methods now properly handle field aliases.
|
|
92
|
-
(Niels Ganser)
|
|
93
|
-
|
|
94
|
-
* \#2895 Allow scopes that return nil to still be chainable. (niedhui)
|
|
95
|
-
|
|
96
697
|
* \#2893 Removed memoization of collection name and database name so lambdas
|
|
97
698
|
with `store_in` work properly when changing.
|
|
98
699
|
|
|
@@ -270,12 +871,14 @@ For instructions on upgrading to newer versions, visit
|
|
|
270
871
|
* \#2465 Documents now have an `attribute_before_type_cast` for proper
|
|
271
872
|
handling of validations. (Gerad Suyderhoud)
|
|
272
873
|
|
|
273
|
-
* \#2443 `expire_after_seconds` is now a valid index option
|
|
874
|
+
* \#2443 `expire_after_seconds` is now a valid index option
|
|
875
|
+
(http://docs.mongodb.org/manual/core/indexes/#ttl-indexes,
|
|
876
|
+
http://docs.mongodb.org/manual/tutorial/expire-data/).
|
|
274
877
|
|
|
275
878
|
class Event
|
|
276
879
|
include Mongoid::Document
|
|
277
|
-
field :
|
|
278
|
-
index({
|
|
880
|
+
field :created_at, type: DateTime
|
|
881
|
+
index({ created_at: 1 }, { expire_after_seconds: 3600 })
|
|
279
882
|
end
|
|
280
883
|
|
|
281
884
|
* \#2373 Relations with the `touch: true` option will now be automatically
|
|
@@ -702,8 +1305,8 @@ For instructions on upgrading to newer versions, visit
|
|
|
702
1305
|
validation fails. Instead, they get flagged for destruction and then the
|
|
703
1306
|
removal occurs upon the parent passing validation and going to persist.
|
|
704
1307
|
|
|
705
|
-
Note this is a
|
|
706
|
-
the previous
|
|
1308
|
+
Note this is a behavior change, but since the API does not change and
|
|
1309
|
+
the previous behavior was incorrect and did not match AR this was able
|
|
707
1310
|
to go into a point release.
|
|
708
1311
|
|
|
709
1312
|
## 3.0.9
|
|
@@ -739,7 +1342,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
739
1342
|
* \#2411 BigDecimal fields are properly stored as strings when mongoizing
|
|
740
1343
|
integers and floats.
|
|
741
1344
|
|
|
742
|
-
* \#2409 Don't warn about missing mongoid.yml if configured
|
|
1345
|
+
* \#2409 Don't warn about missing mongoid.yml if configured programmatically.
|
|
743
1346
|
|
|
744
1347
|
* \#2403 Return false on `update_all` of an embeds many with no documents.
|
|
745
1348
|
|
|
@@ -787,7 +1390,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
787
1390
|
|
|
788
1391
|
* \#2353 Allow `update_attribute` to properly handle aliased fields.
|
|
789
1392
|
|
|
790
|
-
* \#2348 Conversion of strings to times should raise an
|
|
1393
|
+
* \#2348 Conversion of strings to times should raise an argument error if the
|
|
791
1394
|
string is invalid. (Campbell Allen)
|
|
792
1395
|
|
|
793
1396
|
* \#2346 Ensure `belongs_to` relations are evolvable when passed the proxy and
|
|
@@ -1245,18 +1848,18 @@ For instructions on upgrading to newer versions, visit
|
|
|
1245
1848
|
set a child on a relation without the proper inverse_of definitions
|
|
1246
1849
|
due to Mongoid not being able to determine it.
|
|
1247
1850
|
|
|
1248
|
-
class
|
|
1851
|
+
class Car
|
|
1249
1852
|
include Mongoid::Document
|
|
1250
|
-
embeds_one :
|
|
1853
|
+
embeds_one :engine, class_name: "Motor"
|
|
1251
1854
|
end
|
|
1252
1855
|
|
|
1253
|
-
class
|
|
1856
|
+
class Motor
|
|
1254
1857
|
include Mongoid::Document
|
|
1255
|
-
embedded_in :
|
|
1858
|
+
embedded_in :machine, class_name: "Car"
|
|
1256
1859
|
end
|
|
1257
1860
|
|
|
1258
|
-
|
|
1259
|
-
|
|
1861
|
+
car = Car.new
|
|
1862
|
+
car.engine = Motor.new # raises an InverseNotFound error.
|
|
1260
1863
|
|
|
1261
1864
|
* \#1680 Polymorphic relations now use `*_type` keys in lookup queries.
|
|
1262
1865
|
|
|
@@ -1309,7 +1912,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
1309
1912
|
criteria.merge(filter)
|
|
1310
1913
|
|
|
1311
1914
|
* \#1635 All exceptions now provide more comprehensive errors, including
|
|
1312
|
-
the problem that
|
|
1915
|
+
the problem that occurred, a detail summary of why it happened, and
|
|
1313
1916
|
potential resolutions. Example:
|
|
1314
1917
|
|
|
1315
1918
|
(Mongoid::Errors::DocumentNotFound)
|
|
@@ -1326,7 +1929,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
1326
1929
|
false, which will cause a nil to be returned instead
|
|
1327
1930
|
of raising this error.
|
|
1328
1931
|
|
|
1329
|
-
* \#1616 `Model.find_by` added which takes a hash of
|
|
1932
|
+
* \#1616 `Model.find_by` added which takes a hash of arguments to search
|
|
1330
1933
|
for in the database. If no single document is returned a DocumentNotFound
|
|
1331
1934
|
error is raised. (Piotr Jakubowski)
|
|
1332
1935
|
|
|
@@ -1387,7 +1990,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
1387
1990
|
|
|
1388
1991
|
* \#1291 Mongoid now supports any number of database connections as defined in
|
|
1389
1992
|
the mongoid.yml. For example you could have a local single server db, a
|
|
1390
|
-
multi
|
|
1993
|
+
multi availability zone replica set, and a shard cluster all in the same
|
|
1391
1994
|
application environment. Mongoid can connect to any session at any point in
|
|
1392
1995
|
time.
|
|
1393
1996
|
|
|
@@ -1742,7 +2345,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
1742
2345
|
|
|
1743
2346
|
* \#463 `Document#upsert` is no longer aliased to `Document#save` and now
|
|
1744
2347
|
actually performs a proper MongoDB upsert command when called. If you
|
|
1745
|
-
were using this method before and want the same
|
|
2348
|
+
were using this method before and want the same behavior, please switch
|
|
1746
2349
|
to `save`.
|
|
1747
2350
|
|
|
1748
2351
|
band = Band.new(name: "Tool")
|
|
@@ -1798,7 +2401,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
1798
2401
|
* \#1972 `added`, `loaded`, and `unloaded` can now be valid scope names on a
|
|
1799
2402
|
document that is part of a 1-n relation.
|
|
1800
2403
|
|
|
1801
|
-
* \#1952/#1950 `#all_in`
|
|
2404
|
+
* \#1952/#1950 `#all_in` behavior on embedded documents now properly matches
|
|
1802
2405
|
root documents when passing an empty array. (Hans Hasselberg)
|
|
1803
2406
|
|
|
1804
2407
|
* \#1941/#1939 `Model.find_by` now returns nil if raise not found error is
|
|
@@ -2338,7 +2941,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
2338
2941
|
* \#1463 Batch insert consumers are now scoped to collection to avoid persistence
|
|
2339
2942
|
of documents to other collections in callbacks going to the wrong place.
|
|
2340
2943
|
|
|
2341
|
-
* \#1462 Assigning has many relations via nested
|
|
2944
|
+
* \#1462 Assigning has many relations via nested attributes `*_attributes=` does
|
|
2342
2945
|
not autosave the relation.
|
|
2343
2946
|
|
|
2344
2947
|
* \#1461 Fixed serialization of foreign key fields in complex criteria not to
|
|
@@ -2406,7 +3009,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
2406
3009
|
|
|
2407
3010
|
* \#1394 Fix exists? to work when count is greater than 1. (Nick Hoffman)
|
|
2408
3011
|
|
|
2409
|
-
* \#1392 Return 0 on aggregation functions where field is
|
|
3012
|
+
* \#1392 Return 0 on aggregation functions where field is nonexistent.
|
|
2410
3013
|
|
|
2411
3014
|
* \#1391 Uniqueness validation now works properly on embedded documents that are
|
|
2412
3015
|
using primary key definitions.
|
|
@@ -2437,7 +3040,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
2437
3040
|
|
|
2438
3041
|
* \#1386 Lowered mongo/bson dependency to 1.3
|
|
2439
3042
|
|
|
2440
|
-
* \#1377 Fix aggregation functions to properly handle nil or
|
|
3043
|
+
* \#1377 Fix aggregation functions to properly handle nil or undefined values.
|
|
2441
3044
|
(Maxime Garcia)
|
|
2442
3045
|
|
|
2443
3046
|
* \#1373 Warn if a scope overrides another scope.
|
|
@@ -2518,7 +3121,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
2518
3121
|
|
|
2519
3122
|
* \#1287 Fixed max versions limitation with versioning.
|
|
2520
3123
|
|
|
2521
|
-
* \#1277 attribute_will_change! properly flags the attribute even if no change
|
|
3124
|
+
* \#1277 attribute_will_change! properly flags the attribute even if no change occurred.
|
|
2522
3125
|
|
|
2523
3126
|
* \#1063 Paranoid documents properly run destroy callbacks on soft destroy.
|
|
2524
3127
|
|
|
@@ -2553,7 +3156,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
2553
3156
|
|
|
2554
3157
|
* \#1256 Mongoid now can create indexes for models in Rails engines. (Caio Filipini)
|
|
2555
3158
|
|
|
2556
|
-
* \#1228 Allow pre formatting of
|
|
3159
|
+
* \#1228 Allow pre formatting of composite keys by passing a block to #key.
|
|
2557
3160
|
(Ben Hundley)
|
|
2558
3161
|
|
|
2559
3162
|
* \#1222 Scoped mass assignment is now supported. (Andrew Shaydurov)
|
|
@@ -2598,7 +3201,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
2598
3201
|
* \#1273 Mongoid.preload_models now checks if preload configuration option is set,
|
|
2599
3202
|
where Mongoid.load_models always loads everything. (Ryan McGeary)
|
|
2600
3203
|
|
|
2601
|
-
* \#1244 Has one relations now adhere to default dependant
|
|
3204
|
+
* \#1244 Has one relations now adhere to default dependant behavior.
|
|
2602
3205
|
|
|
2603
3206
|
* \#1225 Fixed delayed persistence of embedded documents via $set.
|
|
2604
3207
|
|
|
@@ -2633,7 +3236,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
2633
3236
|
|
|
2634
3237
|
## 2.2.4
|
|
2635
3238
|
|
|
2636
|
-
* \#1377 Fix aggregation functions to properly handle nil or
|
|
3239
|
+
* \#1377 Fix aggregation functions to properly handle nil or undefined values.
|
|
2637
3240
|
(Maxime Garcia)
|
|
2638
3241
|
|
|
2639
3242
|
* \#1373 Warn if a scope overrides another scope.
|
|
@@ -2647,7 +3250,7 @@ For instructions on upgrading to newer versions, visit
|
|
|
2647
3250
|
key without error.
|
|
2648
3251
|
|
|
2649
3252
|
* \#1350, \#1351 Fixed errors in the string conversions of double quotes and
|
|
2650
|
-
tilde when
|
|
3253
|
+
tilde when parameterizing keys.
|
|
2651
3254
|
|
|
2652
3255
|
* \#1349 Mongoid documents should not blow up when including Enumerable.
|
|
2653
3256
|
(Jonas Nicklas)
|
|
@@ -2749,7 +3352,7 @@ validations error from before.
|
|
|
2749
3352
|
|
|
2750
3353
|
* \#1173 has_many relations no longer delete all documents on a set of the relation
|
|
2751
3354
|
(= [ doc_one, doc_two ]) but look to the dependent option to determine what
|
|
2752
|
-
|
|
3355
|
+
behavior should occur. :delete and :destroy will behave as before, :nullify and
|
|
2753
3356
|
no option specified will both nullify the old documents without deleting.
|
|
2754
3357
|
|
|
2755
3358
|
* \#1142, \#767 Embedded relations no longer immediately persist atomically
|