mongoid 8.0.1 → 8.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/config/locales/en.yml +1 -0
  4. data/lib/mongoid/association/accessors.rb +6 -6
  5. data/lib/mongoid/association/bindable.rb +2 -2
  6. data/lib/mongoid/association/constrainable.rb +0 -1
  7. data/lib/mongoid/association/embedded/batchable.rb +5 -5
  8. data/lib/mongoid/association/embedded/cyclic.rb +1 -1
  9. data/lib/mongoid/association/embedded/embedded_in/proxy.rb +2 -2
  10. data/lib/mongoid/association/embedded/embedded_in.rb +1 -1
  11. data/lib/mongoid/association/embedded/embeds_many/proxy.rb +10 -10
  12. data/lib/mongoid/association/embedded/embeds_many.rb +2 -2
  13. data/lib/mongoid/association/embedded/embeds_one/proxy.rb +2 -2
  14. data/lib/mongoid/association/embedded/embeds_one.rb +3 -3
  15. data/lib/mongoid/association/many.rb +6 -7
  16. data/lib/mongoid/association/nested/many.rb +3 -3
  17. data/lib/mongoid/association/nested/nested_buildable.rb +4 -4
  18. data/lib/mongoid/association/nested/one.rb +5 -5
  19. data/lib/mongoid/association/one.rb +2 -2
  20. data/lib/mongoid/association/options.rb +9 -9
  21. data/lib/mongoid/association/proxy.rb +2 -3
  22. data/lib/mongoid/association/referenced/auto_save.rb +1 -1
  23. data/lib/mongoid/association/referenced/belongs_to/proxy.rb +5 -6
  24. data/lib/mongoid/association/referenced/belongs_to.rb +1 -1
  25. data/lib/mongoid/association/referenced/counter_cache.rb +2 -2
  26. data/lib/mongoid/association/referenced/eager.rb +2 -2
  27. data/lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb +2 -2
  28. data/lib/mongoid/association/referenced/has_and_belongs_to_many.rb +2 -2
  29. data/lib/mongoid/association/referenced/has_many/enumerable.rb +10 -10
  30. data/lib/mongoid/association/referenced/has_many/proxy.rb +12 -9
  31. data/lib/mongoid/association/referenced/has_many.rb +3 -3
  32. data/lib/mongoid/association/referenced/has_one/nested_builder.rb +5 -5
  33. data/lib/mongoid/association/referenced/has_one/proxy.rb +1 -1
  34. data/lib/mongoid/association/referenced/has_one.rb +3 -3
  35. data/lib/mongoid/association/referenced/syncable.rb +2 -2
  36. data/lib/mongoid/association/reflections.rb +2 -2
  37. data/lib/mongoid/association/relatable.rb +6 -6
  38. data/lib/mongoid/association.rb +5 -5
  39. data/lib/mongoid/atomic/modifiers.rb +2 -2
  40. data/lib/mongoid/attributes/dynamic.rb +3 -3
  41. data/lib/mongoid/attributes/nested.rb +5 -5
  42. data/lib/mongoid/attributes/processing.rb +1 -1
  43. data/lib/mongoid/attributes/projector.rb +1 -1
  44. data/lib/mongoid/attributes/readonly.rb +2 -2
  45. data/lib/mongoid/attributes.rb +13 -13
  46. data/lib/mongoid/cacheable.rb +2 -2
  47. data/lib/mongoid/changeable.rb +5 -5
  48. data/lib/mongoid/clients/options.rb +1 -1
  49. data/lib/mongoid/clients/validators/storage.rb +3 -3
  50. data/lib/mongoid/config/validators/client.rb +6 -6
  51. data/lib/mongoid/config.rb +7 -7
  52. data/lib/mongoid/contextual/aggregable/memory.rb +1 -1
  53. data/lib/mongoid/contextual/aggregable/mongo.rb +4 -4
  54. data/lib/mongoid/contextual/aggregable/none.rb +1 -1
  55. data/lib/mongoid/contextual/atomic.rb +1 -1
  56. data/lib/mongoid/contextual/geo_near.rb +7 -7
  57. data/lib/mongoid/contextual/memory.rb +5 -5
  58. data/lib/mongoid/contextual/mongo.rb +14 -14
  59. data/lib/mongoid/contextual/none.rb +2 -2
  60. data/lib/mongoid/contextual/queryable.rb +1 -1
  61. data/lib/mongoid/contextual.rb +2 -2
  62. data/lib/mongoid/criteria/findable.rb +7 -4
  63. data/lib/mongoid/criteria/includable.rb +1 -1
  64. data/lib/mongoid/criteria/permission.rb +1 -1
  65. data/lib/mongoid/criteria/queryable/aggregable.rb +2 -2
  66. data/lib/mongoid/criteria/queryable/extensions/boolean.rb +1 -1
  67. data/lib/mongoid/criteria/queryable/extensions/regexp.rb +2 -2
  68. data/lib/mongoid/criteria/queryable/extensions/set.rb +1 -1
  69. data/lib/mongoid/criteria/queryable/extensions/string.rb +3 -3
  70. data/lib/mongoid/criteria/queryable/extensions/symbol.rb +1 -1
  71. data/lib/mongoid/criteria/queryable/key.rb +3 -3
  72. data/lib/mongoid/criteria/queryable/optional.rb +2 -2
  73. data/lib/mongoid/criteria/queryable/options.rb +1 -1
  74. data/lib/mongoid/criteria/queryable/pipeline.rb +1 -1
  75. data/lib/mongoid/criteria/queryable/selectable.rb +3 -3
  76. data/lib/mongoid/criteria/queryable/selector.rb +3 -3
  77. data/lib/mongoid/criteria/queryable/smash.rb +1 -1
  78. data/lib/mongoid/criteria/queryable.rb +1 -1
  79. data/lib/mongoid/criteria/scopable.rb +2 -2
  80. data/lib/mongoid/criteria.rb +14 -9
  81. data/lib/mongoid/deprecable.rb +1 -1
  82. data/lib/mongoid/document.rb +2 -2
  83. data/lib/mongoid/equality.rb +12 -12
  84. data/lib/mongoid/errors/document_not_found.rb +5 -5
  85. data/lib/mongoid/errors/invalid_config_option.rb +1 -1
  86. data/lib/mongoid/errors/invalid_dependent_strategy.rb +1 -1
  87. data/lib/mongoid/errors/invalid_field.rb +1 -1
  88. data/lib/mongoid/errors/invalid_relation.rb +1 -1
  89. data/lib/mongoid/errors/invalid_relation_option.rb +1 -1
  90. data/lib/mongoid/errors/invalid_session_use.rb +1 -1
  91. data/lib/mongoid/errors/invalid_storage_options.rb +1 -1
  92. data/lib/mongoid/errors/mongoid_error.rb +3 -3
  93. data/lib/mongoid/errors/nested_attributes_metadata_not_found.rb +1 -1
  94. data/lib/mongoid/errors/no_client_database.rb +1 -1
  95. data/lib/mongoid/errors/no_client_hosts.rb +1 -1
  96. data/lib/mongoid/errors/readonly_attribute.rb +1 -1
  97. data/lib/mongoid/errors/unknown_attribute.rb +1 -1
  98. data/lib/mongoid/extensions/array.rb +1 -1
  99. data/lib/mongoid/extensions/big_decimal.rb +4 -0
  100. data/lib/mongoid/extensions/false_class.rb +1 -1
  101. data/lib/mongoid/extensions/float.rb +6 -2
  102. data/lib/mongoid/extensions/hash.rb +1 -1
  103. data/lib/mongoid/extensions/integer.rb +6 -2
  104. data/lib/mongoid/extensions/module.rb +1 -1
  105. data/lib/mongoid/extensions/object.rb +6 -6
  106. data/lib/mongoid/extensions/string.rb +9 -9
  107. data/lib/mongoid/extensions/symbol.rb +1 -1
  108. data/lib/mongoid/extensions/true_class.rb +1 -1
  109. data/lib/mongoid/fields/foreign_key.rb +4 -4
  110. data/lib/mongoid/fields/localized.rb +9 -4
  111. data/lib/mongoid/fields/standard.rb +7 -7
  112. data/lib/mongoid/fields.rb +9 -9
  113. data/lib/mongoid/findable.rb +7 -6
  114. data/lib/mongoid/indexable/specification.rb +1 -1
  115. data/lib/mongoid/indexable/validators/options.rb +2 -1
  116. data/lib/mongoid/interceptable.rb +4 -4
  117. data/lib/mongoid/matchable.rb +1 -1
  118. data/lib/mongoid/matcher.rb +12 -7
  119. data/lib/mongoid/persistable/creatable.rb +4 -4
  120. data/lib/mongoid/persistable/deletable.rb +1 -1
  121. data/lib/mongoid/persistable/destroyable.rb +1 -1
  122. data/lib/mongoid/persistable/savable.rb +2 -2
  123. data/lib/mongoid/persistable/unsettable.rb +1 -1
  124. data/lib/mongoid/persistable/updatable.rb +7 -7
  125. data/lib/mongoid/persistable/upsertable.rb +1 -1
  126. data/lib/mongoid/persistable.rb +3 -3
  127. data/lib/mongoid/persistence_context.rb +44 -8
  128. data/lib/mongoid/query_cache.rb +2 -2
  129. data/lib/mongoid/scopable.rb +26 -22
  130. data/lib/mongoid/serializable.rb +10 -6
  131. data/lib/mongoid/stateful.rb +10 -10
  132. data/lib/mongoid/tasks/database.rb +0 -2
  133. data/lib/mongoid/threaded/lifecycle.rb +5 -5
  134. data/lib/mongoid/threaded.rb +12 -12
  135. data/lib/mongoid/timestamps/updated.rb +1 -1
  136. data/lib/mongoid/traversable.rb +3 -3
  137. data/lib/mongoid/validatable/localizable.rb +1 -1
  138. data/lib/mongoid/validatable/macros.rb +0 -2
  139. data/lib/mongoid/validatable/presence.rb +2 -2
  140. data/lib/mongoid/validatable/uniqueness.rb +7 -7
  141. data/lib/mongoid/validatable.rb +6 -6
  142. data/lib/mongoid/version.rb +1 -1
  143. data/spec/integration/i18n_fallbacks_spec.rb +1 -17
  144. data/spec/mongoid/cacheable_spec.rb +3 -3
  145. data/spec/mongoid/clients_spec.rb +25 -0
  146. data/spec/mongoid/contextual/memory_spec.rb +4 -5
  147. data/spec/mongoid/contextual/mongo_spec.rb +2 -4
  148. data/spec/mongoid/criteria_projection_spec.rb +0 -1
  149. data/spec/mongoid/criteria_spec.rb +1 -1
  150. data/spec/mongoid/equality_spec.rb +12 -12
  151. data/spec/mongoid/extensions/big_decimal_spec.rb +15 -0
  152. data/spec/mongoid/extensions/float_spec.rb +10 -3
  153. data/spec/mongoid/extensions/integer_spec.rb +10 -3
  154. data/spec/mongoid/fields/localized_spec.rb +37 -12
  155. data/spec/mongoid/indexable_spec.rb +23 -1
  156. data/spec/mongoid/scopable_spec.rb +34 -16
  157. data/spec/mongoid/validatable/uniqueness_spec.rb +0 -1
  158. data/spec/support/macros.rb +16 -0
  159. data.tar.gz.sig +0 -0
  160. metadata +643 -643
  161. metadata.gz.sig +0 -0
@@ -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