mongoid 7.2.3 → 7.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/Rakefile +16 -0
  5. data/lib/config/locales/en.yml +2 -2
  6. data/lib/mongoid/association/accessors.rb +1 -1
  7. data/lib/mongoid/association/constrainable.rb +1 -1
  8. data/lib/mongoid/association/depending.rb +4 -4
  9. data/lib/mongoid/association/embedded/batchable.rb +1 -1
  10. data/lib/mongoid/association/embedded/embedded_in.rb +1 -1
  11. data/lib/mongoid/association/embedded/embeds_many/proxy.rb +10 -3
  12. data/lib/mongoid/association/nested/many.rb +1 -1
  13. data/lib/mongoid/association/nested/one.rb +4 -2
  14. data/lib/mongoid/association/proxy.rb +6 -1
  15. data/lib/mongoid/association/referenced/auto_save.rb +2 -2
  16. data/lib/mongoid/association/referenced/has_many/enumerable.rb +493 -495
  17. data/lib/mongoid/association/referenced/has_many/proxy.rb +2 -2
  18. data/lib/mongoid/association/referenced/has_one/nested_builder.rb +2 -2
  19. data/lib/mongoid/attributes.rb +24 -13
  20. data/lib/mongoid/attributes/projector.rb +120 -0
  21. data/lib/mongoid/cacheable.rb +2 -2
  22. data/lib/mongoid/clients.rb +1 -1
  23. data/lib/mongoid/clients/factory.rb +22 -8
  24. data/lib/mongoid/config.rb +19 -2
  25. data/lib/mongoid/contextual/aggregable/mongo.rb +10 -8
  26. data/lib/mongoid/copyable.rb +1 -1
  27. data/lib/mongoid/criteria.rb +4 -5
  28. data/lib/mongoid/criteria/findable.rb +1 -1
  29. data/lib/mongoid/criteria/queryable/expandable.rb +0 -24
  30. data/lib/mongoid/criteria/queryable/extensions.rb +0 -4
  31. data/lib/mongoid/criteria/queryable/extensions/boolean.rb +1 -1
  32. data/lib/mongoid/criteria/queryable/mergeable.rb +46 -20
  33. data/lib/mongoid/criteria/queryable/selectable.rb +8 -8
  34. data/lib/mongoid/document.rb +1 -15
  35. data/lib/mongoid/errors/delete_restriction.rb +8 -9
  36. data/lib/mongoid/evolvable.rb +1 -1
  37. data/lib/mongoid/extensions/boolean.rb +1 -2
  38. data/lib/mongoid/extensions/false_class.rb +1 -1
  39. data/lib/mongoid/extensions/hash.rb +2 -2
  40. data/lib/mongoid/extensions/true_class.rb +1 -1
  41. data/lib/mongoid/fields.rb +43 -5
  42. data/lib/mongoid/inspectable.rb +1 -1
  43. data/lib/mongoid/matcher.rb +7 -0
  44. data/lib/mongoid/matcher/bits.rb +41 -0
  45. data/lib/mongoid/matcher/bits_all_clear.rb +20 -0
  46. data/lib/mongoid/matcher/bits_all_set.rb +20 -0
  47. data/lib/mongoid/matcher/bits_any_clear.rb +20 -0
  48. data/lib/mongoid/matcher/bits_any_set.rb +20 -0
  49. data/lib/mongoid/matcher/expression.rb +4 -0
  50. data/lib/mongoid/matcher/field_operator.rb +6 -0
  51. data/lib/mongoid/matcher/mod.rb +17 -0
  52. data/lib/mongoid/matcher/type.rb +99 -0
  53. data/lib/mongoid/persistable/deletable.rb +1 -2
  54. data/lib/mongoid/persistable/destroyable.rb +8 -2
  55. data/lib/mongoid/persistable/updatable.rb +27 -2
  56. data/lib/mongoid/query_cache.rb +35 -29
  57. data/lib/mongoid/selectable.rb +5 -7
  58. data/lib/mongoid/shardable.rb +21 -5
  59. data/lib/mongoid/touchable.rb +23 -4
  60. data/lib/mongoid/version.rb +1 -1
  61. data/spec/integration/associations/embeds_many_spec.rb +44 -0
  62. data/spec/integration/associations/has_one_spec.rb +48 -0
  63. data/spec/integration/criteria/date_field_spec.rb +1 -1
  64. data/spec/integration/document_spec.rb +9 -0
  65. data/spec/integration/matcher_operator_data/bits_all_clear.yml +159 -0
  66. data/spec/integration/matcher_operator_data/bits_all_set.yml +159 -0
  67. data/spec/integration/matcher_operator_data/bits_any_clear.yml +159 -0
  68. data/spec/integration/matcher_operator_data/bits_any_set.yml +159 -0
  69. data/spec/integration/matcher_operator_data/comment.yml +22 -0
  70. data/spec/integration/matcher_operator_data/in.yml +16 -0
  71. data/spec/integration/matcher_operator_data/mod.yml +55 -0
  72. data/spec/integration/matcher_operator_data/type.yml +70 -0
  73. data/spec/integration/matcher_operator_data/type_array.yml +16 -0
  74. data/spec/integration/matcher_operator_data/type_binary.yml +18 -0
  75. data/spec/integration/matcher_operator_data/type_boolean.yml +39 -0
  76. data/spec/integration/matcher_operator_data/type_code.yml +26 -0
  77. data/spec/integration/matcher_operator_data/type_code_with_scope.yml +26 -0
  78. data/spec/integration/matcher_operator_data/type_date.yml +39 -0
  79. data/spec/integration/matcher_operator_data/type_db_pointer.yml +19 -0
  80. data/spec/integration/matcher_operator_data/type_decimal.yml +40 -0
  81. data/spec/integration/matcher_operator_data/type_double.yml +15 -0
  82. data/spec/integration/matcher_operator_data/type_int32.yml +33 -0
  83. data/spec/integration/matcher_operator_data/type_int64.yml +33 -0
  84. data/spec/integration/matcher_operator_data/type_max_key.yml +17 -0
  85. data/spec/integration/matcher_operator_data/type_min_key.yml +17 -0
  86. data/spec/integration/matcher_operator_data/type_null.yml +23 -0
  87. data/spec/integration/matcher_operator_data/type_object.yml +23 -0
  88. data/spec/integration/matcher_operator_data/type_object_id.yml +25 -0
  89. data/spec/integration/matcher_operator_data/type_regex.yml +44 -0
  90. data/spec/integration/matcher_operator_data/type_string.yml +15 -0
  91. data/spec/integration/matcher_operator_data/type_symbol.yml +32 -0
  92. data/spec/integration/matcher_operator_data/type_timestamp.yml +25 -0
  93. data/spec/integration/matcher_operator_data/type_undefined.yml +17 -0
  94. data/spec/lite_spec_helper.rb +2 -0
  95. data/spec/mongoid/association/depending_spec.rb +391 -352
  96. data/spec/mongoid/association/nested/one_spec.rb +18 -14
  97. data/spec/mongoid/association/referenced/belongs_to/proxy_spec.rb +25 -8
  98. data/spec/mongoid/association/referenced/has_and_belongs_to_many/binding_spec.rb +1 -1
  99. data/spec/mongoid/association/referenced/has_many/binding_spec.rb +1 -1
  100. data/spec/mongoid/association/referenced/has_many/enumerable_spec.rb +1 -1
  101. data/spec/mongoid/association/referenced/has_one_models.rb +8 -0
  102. data/spec/mongoid/atomic/paths_spec.rb +64 -12
  103. data/spec/mongoid/attributes/projector_data/embedded.yml +105 -0
  104. data/spec/mongoid/attributes/projector_data/fields.yml +93 -0
  105. data/spec/mongoid/attributes/projector_spec.rb +41 -0
  106. data/spec/mongoid/attributes_spec.rb +98 -6
  107. data/spec/mongoid/clients/factory_spec.rb +48 -0
  108. data/spec/mongoid/config_spec.rb +32 -0
  109. data/spec/mongoid/contextual/mongo_spec.rb +2 -2
  110. data/spec/mongoid/criteria/modifiable_spec.rb +1 -1
  111. data/spec/mongoid/criteria/queryable/expandable_spec.rb +0 -73
  112. data/spec/mongoid/criteria/queryable/extensions/boolean_spec.rb +1 -1
  113. data/spec/mongoid/criteria/queryable/mergeable_spec.rb +105 -7
  114. data/spec/mongoid/criteria/queryable/selectable_logical_spec.rb +229 -24
  115. data/spec/mongoid/criteria/queryable/selectable_shared_examples.rb +39 -0
  116. data/spec/mongoid/criteria/queryable/selectable_spec.rb +1 -565
  117. data/spec/mongoid/criteria/queryable/selectable_where_spec.rb +590 -0
  118. data/spec/mongoid/criteria_projection_spec.rb +411 -0
  119. data/spec/mongoid/criteria_spec.rb +0 -275
  120. data/spec/mongoid/document_spec.rb +13 -13
  121. data/spec/mongoid/errors/delete_restriction_spec.rb +1 -1
  122. data/spec/mongoid/extensions/false_class_spec.rb +1 -1
  123. data/spec/mongoid/extensions/string_spec.rb +5 -5
  124. data/spec/mongoid/extensions/true_class_spec.rb +1 -1
  125. data/spec/mongoid/fields/localized_spec.rb +4 -4
  126. data/spec/mongoid/fields_spec.rb +4 -4
  127. data/spec/mongoid/inspectable_spec.rb +12 -4
  128. data/spec/mongoid/persistable/deletable_spec.rb +175 -1
  129. data/spec/mongoid/persistable/destroyable_spec.rb +191 -3
  130. data/spec/mongoid/persistable/savable_spec.rb +3 -5
  131. data/spec/mongoid/persistable/upsertable_spec.rb +1 -1
  132. data/spec/mongoid/query_cache_middleware_spec.rb +8 -0
  133. data/spec/mongoid/reloadable_spec.rb +18 -1
  134. data/spec/mongoid/shardable_spec.rb +44 -0
  135. data/spec/mongoid/touchable_spec.rb +104 -16
  136. data/spec/mongoid/touchable_spec_models.rb +52 -0
  137. data/spec/mongoid/validatable_spec.rb +1 -1
  138. data/spec/spec_helper.rb +6 -2
  139. data/spec/support/client_registry.rb +9 -0
  140. data/spec/support/models/bolt.rb +8 -0
  141. data/spec/support/models/hole.rb +13 -0
  142. data/spec/support/models/mop.rb +0 -1
  143. data/spec/support/models/nut.rb +8 -0
  144. data/spec/support/models/person.rb +6 -0
  145. data/spec/support/models/sealer.rb +8 -0
  146. data/spec/support/models/shirt.rb +12 -0
  147. data/spec/support/models/spacer.rb +8 -0
  148. data/spec/support/models/threadlocker.rb +8 -0
  149. data/spec/support/models/washer.rb +8 -0
  150. metadata +97 -3
  151. metadata.gz.sig +5 -3
  152. data/spec/support/cluster_config.rb +0 -158
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ # encoding: utf-8
3
+
4
+ class Sealer
5
+ include Mongoid::Document
6
+
7
+ belongs_to :hole
8
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+ # encoding: utf-8
3
+
4
+ class Shirt
5
+ include Mongoid::Document
6
+
7
+ field :color, type: String
8
+
9
+ unalias_attribute :id
10
+
11
+ field :id, type: String
12
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ # encoding: utf-8
3
+
4
+ class Spacer
5
+ include Mongoid::Document
6
+
7
+ belongs_to :hole
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ # encoding: utf-8
3
+
4
+ class Threadlocker
5
+ include Mongoid::Document
6
+
7
+ belongs_to :hole
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ # encoding: utf-8
3
+
4
+ class Washer
5
+ include Mongoid::Document
6
+
7
+ belongs_to :hole
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.3
4
+ version: 7.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Durran Jordan
@@ -176,6 +176,7 @@ files:
176
176
  - lib/mongoid/attributes/dynamic.rb
177
177
  - lib/mongoid/attributes/nested.rb
178
178
  - lib/mongoid/attributes/processing.rb
179
+ - lib/mongoid/attributes/projector.rb
179
180
  - lib/mongoid/attributes/readonly.rb
180
181
  - lib/mongoid/cacheable.rb
181
182
  - lib/mongoid/changeable.rb
@@ -346,6 +347,11 @@ files:
346
347
  - lib/mongoid/matcher.rb
347
348
  - lib/mongoid/matcher/all.rb
348
349
  - lib/mongoid/matcher/and.rb
350
+ - lib/mongoid/matcher/bits.rb
351
+ - lib/mongoid/matcher/bits_all_clear.rb
352
+ - lib/mongoid/matcher/bits_all_set.rb
353
+ - lib/mongoid/matcher/bits_any_clear.rb
354
+ - lib/mongoid/matcher/bits_any_set.rb
349
355
  - lib/mongoid/matcher/elem_match.rb
350
356
  - lib/mongoid/matcher/elem_match_expression.rb
351
357
  - lib/mongoid/matcher/eq.rb
@@ -361,6 +367,7 @@ files:
361
367
  - lib/mongoid/matcher/in.rb
362
368
  - lib/mongoid/matcher/lt.rb
363
369
  - lib/mongoid/matcher/lte.rb
370
+ - lib/mongoid/matcher/mod.rb
364
371
  - lib/mongoid/matcher/ne.rb
365
372
  - lib/mongoid/matcher/nin.rb
366
373
  - lib/mongoid/matcher/nor.rb
@@ -368,6 +375,7 @@ files:
368
375
  - lib/mongoid/matcher/or.rb
369
376
  - lib/mongoid/matcher/regex.rb
370
377
  - lib/mongoid/matcher/size.rb
378
+ - lib/mongoid/matcher/type.rb
371
379
  - lib/mongoid/persistable.rb
372
380
  - lib/mongoid/persistable/creatable.rb
373
381
  - lib/mongoid/persistable/deletable.rb
@@ -455,6 +463,11 @@ files:
455
463
  - spec/integration/matcher_examples_spec.rb
456
464
  - spec/integration/matcher_operator_data/all.yml
457
465
  - spec/integration/matcher_operator_data/and.yml
466
+ - spec/integration/matcher_operator_data/bits_all_clear.yml
467
+ - spec/integration/matcher_operator_data/bits_all_set.yml
468
+ - spec/integration/matcher_operator_data/bits_any_clear.yml
469
+ - spec/integration/matcher_operator_data/bits_any_set.yml
470
+ - spec/integration/matcher_operator_data/comment.yml
458
471
  - spec/integration/matcher_operator_data/elem_match.yml
459
472
  - spec/integration/matcher_operator_data/elem_match_expr.yml
460
473
  - spec/integration/matcher_operator_data/eq.yml
@@ -473,6 +486,7 @@ files:
473
486
  - spec/integration/matcher_operator_data/lt_types.yml
474
487
  - spec/integration/matcher_operator_data/lte.yml
475
488
  - spec/integration/matcher_operator_data/lte_types.yml
489
+ - spec/integration/matcher_operator_data/mod.yml
476
490
  - spec/integration/matcher_operator_data/multiple.yml
477
491
  - spec/integration/matcher_operator_data/ne.yml
478
492
  - spec/integration/matcher_operator_data/ne_types.yml
@@ -483,6 +497,28 @@ files:
483
497
  - spec/integration/matcher_operator_data/regex.yml
484
498
  - spec/integration/matcher_operator_data/regex_options.yml
485
499
  - spec/integration/matcher_operator_data/size.yml
500
+ - spec/integration/matcher_operator_data/type.yml
501
+ - spec/integration/matcher_operator_data/type_array.yml
502
+ - spec/integration/matcher_operator_data/type_binary.yml
503
+ - spec/integration/matcher_operator_data/type_boolean.yml
504
+ - spec/integration/matcher_operator_data/type_code.yml
505
+ - spec/integration/matcher_operator_data/type_code_with_scope.yml
506
+ - spec/integration/matcher_operator_data/type_date.yml
507
+ - spec/integration/matcher_operator_data/type_db_pointer.yml
508
+ - spec/integration/matcher_operator_data/type_decimal.yml
509
+ - spec/integration/matcher_operator_data/type_double.yml
510
+ - spec/integration/matcher_operator_data/type_int32.yml
511
+ - spec/integration/matcher_operator_data/type_int64.yml
512
+ - spec/integration/matcher_operator_data/type_max_key.yml
513
+ - spec/integration/matcher_operator_data/type_min_key.yml
514
+ - spec/integration/matcher_operator_data/type_null.yml
515
+ - spec/integration/matcher_operator_data/type_object.yml
516
+ - spec/integration/matcher_operator_data/type_object_id.yml
517
+ - spec/integration/matcher_operator_data/type_regex.yml
518
+ - spec/integration/matcher_operator_data/type_string.yml
519
+ - spec/integration/matcher_operator_data/type_symbol.yml
520
+ - spec/integration/matcher_operator_data/type_timestamp.yml
521
+ - spec/integration/matcher_operator_data/type_undefined.yml
486
522
  - spec/integration/matcher_operator_spec.rb
487
523
  - spec/integration/matcher_spec.rb
488
524
  - spec/integration/server_query_spec.rb
@@ -561,6 +597,9 @@ files:
561
597
  - spec/mongoid/atomic_spec.rb
562
598
  - spec/mongoid/attributes/dynamic_spec.rb
563
599
  - spec/mongoid/attributes/nested_spec.rb
600
+ - spec/mongoid/attributes/projector_data/embedded.yml
601
+ - spec/mongoid/attributes/projector_data/fields.yml
602
+ - spec/mongoid/attributes/projector_spec.rb
564
603
  - spec/mongoid/attributes/readonly_spec.rb
565
604
  - spec/mongoid/attributes_spec.rb
566
605
  - spec/mongoid/cacheable_spec.rb
@@ -619,11 +658,14 @@ files:
619
658
  - spec/mongoid/criteria/queryable/pipeline_spec.rb
620
659
  - spec/mongoid/criteria/queryable/queryable_spec.rb
621
660
  - spec/mongoid/criteria/queryable/selectable_logical_spec.rb
661
+ - spec/mongoid/criteria/queryable/selectable_shared_examples.rb
622
662
  - spec/mongoid/criteria/queryable/selectable_spec.rb
663
+ - spec/mongoid/criteria/queryable/selectable_where_spec.rb
623
664
  - spec/mongoid/criteria/queryable/selector_spec.rb
624
665
  - spec/mongoid/criteria/queryable/smash_spec.rb
625
666
  - spec/mongoid/criteria/queryable/storable_spec.rb
626
667
  - spec/mongoid/criteria/scopable_spec.rb
668
+ - spec/mongoid/criteria_projection_spec.rb
627
669
  - spec/mongoid/criteria_spec.rb
628
670
  - spec/mongoid/document_fields_spec.rb
629
671
  - spec/mongoid/document_persistence_context_spec.rb
@@ -749,6 +791,7 @@ files:
749
791
  - spec/mongoid/timestamps/updated_spec.rb
750
792
  - spec/mongoid/timestamps_spec.rb
751
793
  - spec/mongoid/touchable_spec.rb
794
+ - spec/mongoid/touchable_spec_models.rb
752
795
  - spec/mongoid/traversable_spec.rb
753
796
  - spec/mongoid/validatable/associated_spec.rb
754
797
  - spec/mongoid/validatable/format_spec.rb
@@ -776,7 +819,7 @@ files:
776
819
  - spec/shared/shlib/set_env.sh
777
820
  - spec/spec_helper.rb
778
821
  - spec/support/authorization.rb
779
- - spec/support/cluster_config.rb
822
+ - spec/support/client_registry.rb
780
823
  - spec/support/constraints.rb
781
824
  - spec/support/expectations.rb
782
825
  - spec/support/helpers.rb
@@ -810,6 +853,7 @@ files:
810
853
  - spec/support/models/bed.rb
811
854
  - spec/support/models/big_palette.rb
812
855
  - spec/support/models/birthday.rb
856
+ - spec/support/models/bolt.rb
813
857
  - spec/support/models/bomb.rb
814
858
  - spec/support/models/book.rb
815
859
  - spec/support/models/breed.rb
@@ -881,6 +925,7 @@ files:
881
925
  - spec/support/models/game.rb
882
926
  - spec/support/models/ghost.rb
883
927
  - spec/support/models/guitar.rb
928
+ - spec/support/models/hole.rb
884
929
  - spec/support/models/home.rb
885
930
  - spec/support/models/house.rb
886
931
  - spec/support/models/html_writer.rb
@@ -914,6 +959,7 @@ files:
914
959
  - spec/support/models/name_only.rb
915
960
  - spec/support/models/node.rb
916
961
  - spec/support/models/note.rb
962
+ - spec/support/models/nut.rb
917
963
  - spec/support/models/odd.rb
918
964
  - spec/support/models/order.rb
919
965
  - spec/support/models/ordered_post.rb
@@ -963,6 +1009,7 @@ files:
963
1009
  - spec/support/models/sandwich.rb
964
1010
  - spec/support/models/scheduler.rb
965
1011
  - spec/support/models/scribe.rb
1012
+ - spec/support/models/sealer.rb
966
1013
  - spec/support/models/seat.rb
967
1014
  - spec/support/models/seo.rb
968
1015
  - spec/support/models/series.rb
@@ -973,6 +1020,7 @@ files:
973
1020
  - spec/support/models/shipment_address.rb
974
1021
  - spec/support/models/shipping_container.rb
975
1022
  - spec/support/models/shipping_pack.rb
1023
+ - spec/support/models/shirt.rb
976
1024
  - spec/support/models/shop.rb
977
1025
  - spec/support/models/short_agent.rb
978
1026
  - spec/support/models/short_quiz.rb
@@ -980,6 +1028,7 @@ files:
980
1028
  - spec/support/models/slave.rb
981
1029
  - spec/support/models/song.rb
982
1030
  - spec/support/models/sound.rb
1031
+ - spec/support/models/spacer.rb
983
1032
  - spec/support/models/square.rb
984
1033
  - spec/support/models/staff.rb
985
1034
  - spec/support/models/store_as_dup_test1.rb
@@ -996,6 +1045,7 @@ files:
996
1045
  - spec/support/models/target.rb
997
1046
  - spec/support/models/template.rb
998
1047
  - spec/support/models/thing.rb
1048
+ - spec/support/models/threadlocker.rb
999
1049
  - spec/support/models/title.rb
1000
1050
  - spec/support/models/tool.rb
1001
1051
  - spec/support/models/topping.rb
@@ -1014,6 +1064,7 @@ files:
1014
1064
  - spec/support/models/vet_visit.rb
1015
1065
  - spec/support/models/video.rb
1016
1066
  - spec/support/models/video_game.rb
1067
+ - spec/support/models/washer.rb
1017
1068
  - spec/support/models/weapon.rb
1018
1069
  - spec/support/models/wiki_page.rb
1019
1070
  - spec/support/models/word.rb
@@ -1121,9 +1172,11 @@ test_files:
1121
1172
  - spec/mongoid/association/referenced/has_many_spec.rb
1122
1173
  - spec/mongoid/association/options_spec.rb
1123
1174
  - spec/mongoid/association/reflections_spec.rb
1175
+ - spec/mongoid/touchable_spec_models.rb
1124
1176
  - spec/mongoid/reloadable_spec.rb
1125
1177
  - spec/mongoid/indexable/specification_spec.rb
1126
1178
  - spec/mongoid/document_persistence_context_spec.rb
1179
+ - spec/mongoid/criteria_projection_spec.rb
1127
1180
  - spec/mongoid/extensions/date_class_mongoize_spec.rb
1128
1181
  - spec/mongoid/extensions/time_spec.rb
1129
1182
  - spec/mongoid/extensions/array_spec.rb
@@ -1292,6 +1345,7 @@ test_files:
1292
1345
  - spec/mongoid/criteria/queryable/storable_spec.rb
1293
1346
  - spec/mongoid/criteria/queryable/pipeline_spec.rb
1294
1347
  - spec/mongoid/criteria/queryable/selectable_logical_spec.rb
1348
+ - spec/mongoid/criteria/queryable/selectable_where_spec.rb
1295
1349
  - spec/mongoid/criteria/queryable/optional_spec.rb
1296
1350
  - spec/mongoid/criteria/queryable/mergeable_spec.rb
1297
1351
  - spec/mongoid/criteria/queryable/queryable_spec.rb
@@ -1300,6 +1354,7 @@ test_files:
1300
1354
  - spec/mongoid/criteria/queryable/smash_spec.rb
1301
1355
  - spec/mongoid/criteria/queryable/key_spec.rb
1302
1356
  - spec/mongoid/criteria/queryable/options_spec.rb
1357
+ - spec/mongoid/criteria/queryable/selectable_shared_examples.rb
1303
1358
  - spec/mongoid/criteria/queryable/selectable_spec.rb
1304
1359
  - spec/mongoid/criteria/marshalable_spec.rb
1305
1360
  - spec/mongoid/criteria/findable_spec.rb
@@ -1313,9 +1368,12 @@ test_files:
1313
1368
  - spec/mongoid/timestamps_spec.rb
1314
1369
  - spec/mongoid/changeable_spec.rb
1315
1370
  - spec/mongoid/stateful_spec.rb
1371
+ - spec/mongoid/attributes/projector_spec.rb
1316
1372
  - spec/mongoid/attributes/readonly_spec.rb
1317
1373
  - spec/mongoid/attributes/nested_spec.rb
1318
1374
  - spec/mongoid/attributes/dynamic_spec.rb
1375
+ - spec/mongoid/attributes/projector_data/fields.yml
1376
+ - spec/mongoid/attributes/projector_data/embedded.yml
1319
1377
  - spec/mongoid/interceptable_spec_models.rb
1320
1378
  - spec/mongoid/indexable_spec.rb
1321
1379
  - spec/mongoid/document_query_spec.rb
@@ -1362,10 +1420,12 @@ test_files:
1362
1420
  - spec/support/models/shape.rb
1363
1421
  - spec/support/models/definition.rb
1364
1422
  - spec/support/models/pet.rb
1423
+ - spec/support/models/threadlocker.rb
1365
1424
  - spec/support/models/pdf_writer.rb
1366
1425
  - spec/support/models/pet_owner.rb
1367
1426
  - spec/support/models/courier_job.rb
1368
1427
  - spec/support/models/store_as_dup_test2.rb
1428
+ - spec/support/models/spacer.rb
1369
1429
  - spec/support/models/powerup.rb
1370
1430
  - spec/support/models/role.rb
1371
1431
  - spec/support/models/eye.rb
@@ -1379,6 +1439,7 @@ test_files:
1379
1439
  - spec/support/models/code.rb
1380
1440
  - spec/support/models/account.rb
1381
1441
  - spec/support/models/store_as_dup_test1.rb
1442
+ - spec/support/models/shirt.rb
1382
1443
  - spec/support/models/entry.rb
1383
1444
  - spec/support/models/folder.rb
1384
1445
  - spec/support/models/contractor.rb
@@ -1397,6 +1458,7 @@ test_files:
1397
1458
  - spec/support/models/id_key.rb
1398
1459
  - spec/support/models/override.rb
1399
1460
  - spec/support/models/parent_doc.rb
1461
+ - spec/support/models/hole.rb
1400
1462
  - spec/support/models/scribe.rb
1401
1463
  - spec/support/models/band.rb
1402
1464
  - spec/support/models/address_number.rb
@@ -1409,6 +1471,7 @@ test_files:
1409
1471
  - spec/support/models/employer.rb
1410
1472
  - spec/support/models/sound.rb
1411
1473
  - spec/support/models/scheduler.rb
1474
+ - spec/support/models/nut.rb
1412
1475
  - spec/support/models/series.rb
1413
1476
  - spec/support/models/rating.rb
1414
1477
  - spec/support/models/manufacturer.rb
@@ -1477,10 +1540,12 @@ test_files:
1477
1540
  - spec/support/models/thing.rb
1478
1541
  - spec/support/models/church.rb
1479
1542
  - spec/support/models/league.rb
1543
+ - spec/support/models/bolt.rb
1480
1544
  - spec/support/models/toy.rb
1481
1545
  - spec/support/models/vehicle.rb
1482
1546
  - spec/support/models/seat.rb
1483
1547
  - spec/support/models/home.rb
1548
+ - spec/support/models/washer.rb
1484
1549
  - spec/support/models/circus.rb
1485
1550
  - spec/support/models/callback_test.rb
1486
1551
  - spec/support/models/vertex.rb
@@ -1513,6 +1578,7 @@ test_files:
1513
1578
  - spec/support/models/division.rb
1514
1579
  - spec/support/models/coding.rb
1515
1580
  - spec/support/models/sandwich.rb
1581
+ - spec/support/models/sealer.rb
1516
1582
  - spec/support/models/video_game.rb
1517
1583
  - spec/support/models/baby.rb
1518
1584
  - spec/support/models/question.rb
@@ -1583,7 +1649,7 @@ test_files:
1583
1649
  - spec/support/macros.rb
1584
1650
  - spec/support/expectations.rb
1585
1651
  - spec/support/constraints.rb
1586
- - spec/support/cluster_config.rb
1652
+ - spec/support/client_registry.rb
1587
1653
  - spec/support/spec_config.rb
1588
1654
  - spec/integration/bson_regexp_raw_spec.rb
1589
1655
  - spec/integration/document_spec.rb
@@ -1600,36 +1666,64 @@ test_files:
1600
1666
  - spec/integration/associations/belongs_to_spec.rb
1601
1667
  - spec/integration/associations/foreign_key_spec.rb
1602
1668
  - spec/integration/associations/has_many_spec.rb
1669
+ - spec/integration/matcher_operator_data/bits_any_set.yml
1603
1670
  - spec/integration/matcher_operator_data/elem_match_expr.yml
1671
+ - spec/integration/matcher_operator_data/type_binary.yml
1604
1672
  - spec/integration/matcher_operator_data/eq.yml
1673
+ - spec/integration/matcher_operator_data/bits_any_clear.yml
1605
1674
  - spec/integration/matcher_operator_data/gt_types.yml
1606
1675
  - spec/integration/matcher_operator_data/regex_options.yml
1607
1676
  - spec/integration/matcher_operator_data/exists.yml
1608
1677
  - spec/integration/matcher_operator_data/nor.yml
1609
1678
  - spec/integration/matcher_operator_data/multiple.yml
1679
+ - spec/integration/matcher_operator_data/bits_all_clear.yml
1610
1680
  - spec/integration/matcher_operator_data/lt.yml
1681
+ - spec/integration/matcher_operator_data/mod.yml
1682
+ - spec/integration/matcher_operator_data/type_timestamp.yml
1683
+ - spec/integration/matcher_operator_data/bits_all_set.yml
1684
+ - spec/integration/matcher_operator_data/type_array.yml
1611
1685
  - spec/integration/matcher_operator_data/lt_types.yml
1612
1686
  - spec/integration/matcher_operator_data/invalid_syntax.yml
1687
+ - spec/integration/matcher_operator_data/comment.yml
1613
1688
  - spec/integration/matcher_operator_data/not.yml
1689
+ - spec/integration/matcher_operator_data/type_boolean.yml
1690
+ - spec/integration/matcher_operator_data/type_decimal.yml
1614
1691
  - spec/integration/matcher_operator_data/gte_types.yml
1615
1692
  - spec/integration/matcher_operator_data/invalid_op.yml
1693
+ - spec/integration/matcher_operator_data/type_min_key.yml
1616
1694
  - spec/integration/matcher_operator_data/ne.yml
1695
+ - spec/integration/matcher_operator_data/type_date.yml
1696
+ - spec/integration/matcher_operator_data/type_int64.yml
1617
1697
  - spec/integration/matcher_operator_data/size.yml
1698
+ - spec/integration/matcher_operator_data/type.yml
1618
1699
  - spec/integration/matcher_operator_data/or.yml
1700
+ - spec/integration/matcher_operator_data/type_object.yml
1619
1701
  - spec/integration/matcher_operator_data/ne_types.yml
1702
+ - spec/integration/matcher_operator_data/type_int32.yml
1620
1703
  - spec/integration/matcher_operator_data/gte.yml
1621
1704
  - spec/integration/matcher_operator_data/nin.yml
1705
+ - spec/integration/matcher_operator_data/type_code.yml
1706
+ - spec/integration/matcher_operator_data/type_symbol.yml
1707
+ - spec/integration/matcher_operator_data/type_regex.yml
1622
1708
  - spec/integration/matcher_operator_data/lte_types.yml
1623
1709
  - spec/integration/matcher_operator_data/in.yml
1710
+ - spec/integration/matcher_operator_data/type_code_with_scope.yml
1624
1711
  - spec/integration/matcher_operator_data/all.yml
1625
1712
  - spec/integration/matcher_operator_data/lte.yml
1626
1713
  - spec/integration/matcher_operator_data/and.yml
1714
+ - spec/integration/matcher_operator_data/type_db_pointer.yml
1627
1715
  - spec/integration/matcher_operator_data/implicit_traversal.yml
1628
1716
  - spec/integration/matcher_operator_data/gt.yml
1717
+ - spec/integration/matcher_operator_data/type_double.yml
1718
+ - spec/integration/matcher_operator_data/type_string.yml
1719
+ - spec/integration/matcher_operator_data/type_null.yml
1629
1720
  - spec/integration/matcher_operator_data/regex.yml
1721
+ - spec/integration/matcher_operator_data/type_object_id.yml
1722
+ - spec/integration/matcher_operator_data/type_max_key.yml
1630
1723
  - spec/integration/matcher_operator_data/implicit.yml
1631
1724
  - spec/integration/matcher_operator_data/elem_match.yml
1632
1725
  - spec/integration/matcher_operator_data/generic_op.yml
1726
+ - spec/integration/matcher_operator_data/type_undefined.yml
1633
1727
  - spec/integration/callbacks_models.rb
1634
1728
  - spec/integration/matcher_spec.rb
1635
1729
  - spec/integration/shardable_spec.rb
metadata.gz.sig CHANGED
@@ -1,3 +1,5 @@
1
- z[��
2
- ���ѥ0����(��‰s\�m5&0����4�.?�X�7�֐�;�r�G~z��N?aC3m�*] u�]EC�1(U7{�>'0��uE�Ƴ�2}Sۂ�2W��� yF^2V�̒A��
3
- ٝ�
1
+ 6�}X��j0�wE��?B�&��v3�ϳl��DK��(�)�H�$vୁ`U�
2
+ ��^&h�>�Ĭ��ی,��}�
3
+ ,UM;Y䆝�݉�"���IS�%
4
+ ���h6��{&���U`�Va�A��?��(?��9��i��,}{���)� t����"
5
+ ����?
@@ -1,158 +0,0 @@
1
- # frozen_string_literal: true
2
- # encoding: utf-8
3
-
4
- require 'singleton'
5
-
6
- class ClusterConfig
7
- include Singleton
8
-
9
- def single_server?
10
- determine_cluster_config
11
- @single_server
12
- end
13
-
14
- def replica_set_name
15
- determine_cluster_config
16
- @replica_set_name
17
- end
18
-
19
- def server_version
20
- determine_cluster_config
21
- @server_version
22
- end
23
-
24
- def short_server_version
25
- server_version.split('.')[0..1].join('.')
26
- end
27
-
28
- def fcv
29
- determine_cluster_config
30
- @fcv
31
- end
32
-
33
- # Per https://jira.mongodb.org/browse/SERVER-39052, working with FCV
34
- # in sharded topologies is annoying. Also, FCV doesn't exist in servers
35
- # less than 3.4. This method returns FCV on 3.4+ servers when in single
36
- # or RS topologies, and otherwise returns the major.minor server version.
37
- def fcv_ish
38
- if server_version >= '3.4' && topology != :sharded
39
- fcv
40
- else
41
- if short_server_version == '4.1'
42
- '4.2'
43
- else
44
- short_server_version
45
- end
46
- end
47
- end
48
-
49
- def primary_address
50
- determine_cluster_config
51
- @primary_address
52
- end
53
-
54
- def primary_address_str
55
- determine_cluster_config
56
- @primary_address.seed
57
- end
58
-
59
- def primary_address_host
60
- both = primary_address_str
61
- both.split(':').first
62
- end
63
-
64
- def primary_address_port
65
- both = primary_address_str
66
- both.split(':')[1] || 27017
67
- end
68
-
69
- def primary_description
70
- determine_cluster_config
71
- @primary_description
72
- end
73
-
74
- # Try running a command on the admin database to see if the mongod was
75
- # started with auth.
76
- def auth_enabled?
77
- if @auth_enabled.nil?
78
- @auth_enabled = begin
79
- basic_client.use(:admin).command(getCmdLineOpts: 1).first["argv"].include?("--auth")
80
- rescue => e
81
- e.message =~ /(not authorized)|(unauthorized)|(no users authenticated)|(requires authentication)/
82
- end
83
- end
84
- @auth_enabled
85
- end
86
-
87
- def topology
88
- determine_cluster_config
89
- @topology
90
- end
91
-
92
- def storage_engine
93
- @storage_engine ||= begin
94
- # 2.6 does not have wired tiger
95
- if short_server_version == '2.6'
96
- :mmapv1
97
- else
98
- client = ClientRegistry.instance.global_client('root_authorized')
99
- if topology == :sharded
100
- shards = client.use(:admin).command(listShards: 1).first
101
- shard = shards['shards'].first
102
- address_str = shard['host'].sub(/\A.*\//, '').sub(/,.*/, '')
103
- client = ClusterTools.instance.direct_client(address_str,
104
- SpecConfig.instance.test_options.merge(SpecConfig.instance.auth_options).merge(connect: :direct))
105
- end
106
- rv = client.use(:admin).command(serverStatus: 1).first
107
- rv = rv['storageEngine']['name']
108
- rv_map = {
109
- 'wiredTiger' => :wired_tiger,
110
- 'mmapv1' => :mmapv1,
111
- }
112
- rv_map[rv] || rv
113
- end
114
- end
115
- end
116
-
117
- private
118
-
119
- def determine_cluster_config
120
- return if @primary_address
121
-
122
- # Run all commands to figure out the cluster configuration from the same
123
- # client. This is somewhat wasteful when running a single test, but reduces
124
- # test runtime for the suite overall because all commands are sent on the
125
- # same connection rather than each command connecting to the cluster by
126
- # itself.
127
- client = Mongoid::Clients.default
128
-
129
- primary = client.cluster.next_primary
130
- @primary_address = primary.address
131
- @primary_description = primary.description
132
- @replica_set_name = client.cluster.topology.replica_set_name
133
-
134
- @topology ||= begin
135
- topology = client.cluster.topology.class.name.sub(/.*::/, '')
136
- topology = topology.gsub(/([A-Z])/) { |match| '_' + match.downcase }.sub(/\A_/, '')
137
- if topology =~ /\Areplica_set/
138
- topology = 'replica_set'
139
- end
140
- topology.to_sym
141
- end
142
-
143
- @single_server = client.cluster.send(:servers_list).length == 1
144
-
145
- @server_version = client.database.command(buildInfo: 1).first['version']
146
-
147
- if @topology != :sharded && short_server_version >= '3.4'
148
- rv = client.use(:admin).command(getParameter: 1, featureCompatibilityVersion: 1).first['featureCompatibilityVersion']
149
- @fcv = rv['version'] || rv
150
- end
151
- end
152
-
153
- def basic_client
154
- # Do not cache the result here so that if the client gets closed,
155
- # client registry reconnects it in subsequent tests
156
- ClientRegistry.instance.global_client('basic')
157
- end
158
- end