mongoid 8.0.1 → 8.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/config/locales/en.yml +1 -0
- data/lib/mongoid/association/accessors.rb +6 -6
- data/lib/mongoid/association/bindable.rb +2 -2
- data/lib/mongoid/association/constrainable.rb +0 -1
- data/lib/mongoid/association/embedded/batchable.rb +5 -5
- data/lib/mongoid/association/embedded/cyclic.rb +1 -1
- data/lib/mongoid/association/embedded/embedded_in/proxy.rb +2 -2
- data/lib/mongoid/association/embedded/embedded_in.rb +1 -1
- data/lib/mongoid/association/embedded/embeds_many/proxy.rb +10 -10
- data/lib/mongoid/association/embedded/embeds_many.rb +2 -2
- data/lib/mongoid/association/embedded/embeds_one/proxy.rb +2 -2
- data/lib/mongoid/association/embedded/embeds_one.rb +3 -3
- data/lib/mongoid/association/many.rb +6 -7
- data/lib/mongoid/association/nested/many.rb +3 -3
- data/lib/mongoid/association/nested/nested_buildable.rb +4 -4
- data/lib/mongoid/association/nested/one.rb +5 -5
- data/lib/mongoid/association/one.rb +2 -2
- data/lib/mongoid/association/options.rb +9 -9
- data/lib/mongoid/association/proxy.rb +2 -3
- data/lib/mongoid/association/referenced/auto_save.rb +1 -1
- data/lib/mongoid/association/referenced/belongs_to/proxy.rb +5 -6
- data/lib/mongoid/association/referenced/belongs_to.rb +1 -1
- data/lib/mongoid/association/referenced/counter_cache.rb +2 -2
- data/lib/mongoid/association/referenced/eager.rb +2 -2
- data/lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb +2 -2
- data/lib/mongoid/association/referenced/has_and_belongs_to_many.rb +2 -2
- data/lib/mongoid/association/referenced/has_many/enumerable.rb +10 -10
- data/lib/mongoid/association/referenced/has_many/proxy.rb +12 -9
- data/lib/mongoid/association/referenced/has_many.rb +3 -3
- data/lib/mongoid/association/referenced/has_one/nested_builder.rb +5 -5
- data/lib/mongoid/association/referenced/has_one/proxy.rb +1 -1
- data/lib/mongoid/association/referenced/has_one.rb +3 -3
- data/lib/mongoid/association/referenced/syncable.rb +2 -2
- data/lib/mongoid/association/reflections.rb +2 -2
- data/lib/mongoid/association/relatable.rb +6 -6
- data/lib/mongoid/association.rb +5 -5
- data/lib/mongoid/atomic/modifiers.rb +2 -2
- data/lib/mongoid/attributes/dynamic.rb +3 -3
- data/lib/mongoid/attributes/nested.rb +5 -5
- data/lib/mongoid/attributes/processing.rb +1 -1
- data/lib/mongoid/attributes/projector.rb +1 -1
- data/lib/mongoid/attributes/readonly.rb +2 -2
- data/lib/mongoid/attributes.rb +13 -13
- data/lib/mongoid/cacheable.rb +2 -2
- data/lib/mongoid/changeable.rb +5 -5
- data/lib/mongoid/clients/options.rb +1 -1
- data/lib/mongoid/clients/validators/storage.rb +3 -3
- data/lib/mongoid/config/validators/client.rb +6 -6
- data/lib/mongoid/config.rb +7 -7
- data/lib/mongoid/contextual/aggregable/memory.rb +1 -1
- data/lib/mongoid/contextual/aggregable/mongo.rb +4 -4
- data/lib/mongoid/contextual/aggregable/none.rb +1 -1
- data/lib/mongoid/contextual/atomic.rb +1 -1
- data/lib/mongoid/contextual/geo_near.rb +7 -7
- data/lib/mongoid/contextual/memory.rb +5 -5
- data/lib/mongoid/contextual/mongo.rb +14 -14
- data/lib/mongoid/contextual/none.rb +2 -2
- data/lib/mongoid/contextual/queryable.rb +1 -1
- data/lib/mongoid/contextual.rb +2 -2
- data/lib/mongoid/criteria/findable.rb +7 -4
- data/lib/mongoid/criteria/includable.rb +1 -1
- data/lib/mongoid/criteria/permission.rb +1 -1
- data/lib/mongoid/criteria/queryable/aggregable.rb +2 -2
- data/lib/mongoid/criteria/queryable/extensions/boolean.rb +1 -1
- data/lib/mongoid/criteria/queryable/extensions/regexp.rb +2 -2
- data/lib/mongoid/criteria/queryable/extensions/set.rb +1 -1
- data/lib/mongoid/criteria/queryable/extensions/string.rb +3 -3
- data/lib/mongoid/criteria/queryable/extensions/symbol.rb +1 -1
- data/lib/mongoid/criteria/queryable/key.rb +3 -3
- data/lib/mongoid/criteria/queryable/optional.rb +2 -2
- data/lib/mongoid/criteria/queryable/options.rb +1 -1
- data/lib/mongoid/criteria/queryable/pipeline.rb +1 -1
- data/lib/mongoid/criteria/queryable/selectable.rb +3 -3
- data/lib/mongoid/criteria/queryable/selector.rb +3 -3
- data/lib/mongoid/criteria/queryable/smash.rb +1 -1
- data/lib/mongoid/criteria/queryable.rb +1 -1
- data/lib/mongoid/criteria/scopable.rb +2 -2
- data/lib/mongoid/criteria.rb +14 -9
- data/lib/mongoid/deprecable.rb +1 -1
- data/lib/mongoid/document.rb +2 -2
- data/lib/mongoid/equality.rb +12 -12
- data/lib/mongoid/errors/document_not_found.rb +5 -5
- data/lib/mongoid/errors/invalid_config_option.rb +1 -1
- data/lib/mongoid/errors/invalid_dependent_strategy.rb +1 -1
- data/lib/mongoid/errors/invalid_field.rb +1 -1
- data/lib/mongoid/errors/invalid_relation.rb +1 -1
- data/lib/mongoid/errors/invalid_relation_option.rb +1 -1
- data/lib/mongoid/errors/invalid_session_use.rb +1 -1
- data/lib/mongoid/errors/invalid_storage_options.rb +1 -1
- data/lib/mongoid/errors/mongoid_error.rb +3 -3
- data/lib/mongoid/errors/nested_attributes_metadata_not_found.rb +1 -1
- data/lib/mongoid/errors/no_client_database.rb +1 -1
- data/lib/mongoid/errors/no_client_hosts.rb +1 -1
- data/lib/mongoid/errors/readonly_attribute.rb +1 -1
- data/lib/mongoid/errors/unknown_attribute.rb +1 -1
- data/lib/mongoid/extensions/array.rb +1 -1
- data/lib/mongoid/extensions/big_decimal.rb +4 -0
- data/lib/mongoid/extensions/false_class.rb +1 -1
- data/lib/mongoid/extensions/float.rb +6 -2
- data/lib/mongoid/extensions/hash.rb +1 -1
- data/lib/mongoid/extensions/integer.rb +6 -2
- data/lib/mongoid/extensions/module.rb +1 -1
- data/lib/mongoid/extensions/object.rb +6 -6
- data/lib/mongoid/extensions/string.rb +9 -9
- data/lib/mongoid/extensions/symbol.rb +1 -1
- data/lib/mongoid/extensions/true_class.rb +1 -1
- data/lib/mongoid/fields/foreign_key.rb +4 -4
- data/lib/mongoid/fields/localized.rb +9 -4
- data/lib/mongoid/fields/standard.rb +7 -7
- data/lib/mongoid/fields.rb +9 -9
- data/lib/mongoid/findable.rb +7 -6
- data/lib/mongoid/indexable/specification.rb +1 -1
- data/lib/mongoid/indexable/validators/options.rb +2 -1
- data/lib/mongoid/interceptable.rb +4 -4
- data/lib/mongoid/matchable.rb +1 -1
- data/lib/mongoid/matcher.rb +12 -7
- data/lib/mongoid/persistable/creatable.rb +4 -4
- data/lib/mongoid/persistable/deletable.rb +1 -1
- data/lib/mongoid/persistable/destroyable.rb +1 -1
- data/lib/mongoid/persistable/savable.rb +2 -2
- data/lib/mongoid/persistable/unsettable.rb +1 -1
- data/lib/mongoid/persistable/updatable.rb +7 -7
- data/lib/mongoid/persistable/upsertable.rb +1 -1
- data/lib/mongoid/persistable.rb +3 -3
- data/lib/mongoid/persistence_context.rb +44 -8
- data/lib/mongoid/query_cache.rb +2 -2
- data/lib/mongoid/scopable.rb +26 -22
- data/lib/mongoid/serializable.rb +10 -6
- data/lib/mongoid/stateful.rb +10 -10
- data/lib/mongoid/tasks/database.rb +0 -2
- data/lib/mongoid/threaded/lifecycle.rb +5 -5
- data/lib/mongoid/threaded.rb +12 -12
- data/lib/mongoid/timestamps/updated.rb +1 -1
- data/lib/mongoid/traversable.rb +3 -3
- data/lib/mongoid/validatable/localizable.rb +1 -1
- data/lib/mongoid/validatable/macros.rb +0 -2
- data/lib/mongoid/validatable/presence.rb +2 -2
- data/lib/mongoid/validatable/uniqueness.rb +7 -7
- data/lib/mongoid/validatable.rb +6 -6
- data/lib/mongoid/version.rb +1 -1
- data/spec/integration/i18n_fallbacks_spec.rb +1 -17
- data/spec/mongoid/cacheable_spec.rb +3 -3
- data/spec/mongoid/clients_spec.rb +25 -0
- data/spec/mongoid/contextual/memory_spec.rb +4 -5
- data/spec/mongoid/contextual/mongo_spec.rb +2 -4
- data/spec/mongoid/criteria_projection_spec.rb +0 -1
- data/spec/mongoid/criteria_spec.rb +1 -1
- data/spec/mongoid/equality_spec.rb +12 -12
- data/spec/mongoid/extensions/big_decimal_spec.rb +15 -0
- data/spec/mongoid/extensions/float_spec.rb +10 -3
- data/spec/mongoid/extensions/integer_spec.rb +10 -3
- data/spec/mongoid/fields/localized_spec.rb +37 -12
- data/spec/mongoid/indexable_spec.rb +23 -1
- data/spec/mongoid/scopable_spec.rb +34 -16
- data/spec/mongoid/validatable/uniqueness_spec.rb +0 -1
- data/spec/support/macros.rb +16 -0
- data.tar.gz.sig +0 -0
- metadata +643 -643
- metadata.gz.sig +0 -0
data/spec/support/macros.rb
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
module Mongoid
|
4
4
|
module Macros
|
5
|
+
class I18nBackendWithFallbacks < I18n::Backend::Simple
|
6
|
+
include I18n::Backend::Fallbacks
|
7
|
+
end
|
8
|
+
|
5
9
|
def use_spec_mongoid_config
|
6
10
|
around do |example|
|
7
11
|
config_path = File.join(File.dirname(__FILE__), "..", "config", "mongoid.yml")
|
@@ -39,6 +43,18 @@ module Mongoid
|
|
39
43
|
end
|
40
44
|
end
|
41
45
|
|
46
|
+
def with_i18n_fallbacks
|
47
|
+
require_fallbacks
|
48
|
+
|
49
|
+
around do |example|
|
50
|
+
old_backend = I18n.backend
|
51
|
+
I18n.backend = I18nBackendWithFallbacks.new
|
52
|
+
example.run
|
53
|
+
ensure
|
54
|
+
I18n.backend = old_backend
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
42
58
|
def driver_config_override(key, value)
|
43
59
|
around do |example|
|
44
60
|
existing = Mongo.send(key)
|
data.tar.gz.sig
CHANGED
Binary file
|