mongoid 7.2.6 → 7.3.0
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/README.md +1 -1
- data/Rakefile +16 -0
- data/lib/config/locales/en.yml +2 -15
- data/lib/mongoid/association/accessors.rb +1 -1
- data/lib/mongoid/association/constrainable.rb +1 -1
- data/lib/mongoid/association/depending.rb +4 -4
- data/lib/mongoid/association/embedded/batchable.rb +1 -1
- data/lib/mongoid/association/embedded/embedded_in.rb +1 -1
- data/lib/mongoid/association/embedded/embeds_many/proxy.rb +11 -4
- data/lib/mongoid/association/nested/many.rb +1 -1
- data/lib/mongoid/association/nested/one.rb +4 -2
- data/lib/mongoid/association/proxy.rb +7 -2
- data/lib/mongoid/association/referenced/auto_save.rb +2 -2
- data/lib/mongoid/association/referenced/has_many/enumerable.rb +493 -495
- data/lib/mongoid/association/referenced/has_many/proxy.rb +3 -3
- data/lib/mongoid/association/referenced/has_one/nested_builder.rb +2 -2
- data/lib/mongoid/association/relatable.rb +0 -2
- data/lib/mongoid/attributes/projector.rb +120 -0
- data/lib/mongoid/attributes.rb +24 -13
- data/lib/mongoid/cacheable.rb +2 -2
- data/lib/mongoid/clients/factory.rb +22 -8
- data/lib/mongoid/clients.rb +1 -1
- data/lib/mongoid/config/environment.rb +1 -9
- data/lib/mongoid/config.rb +19 -2
- data/lib/mongoid/contextual/aggregable/mongo.rb +10 -8
- data/lib/mongoid/contextual/atomic.rb +2 -7
- data/lib/mongoid/contextual/none.rb +0 -3
- data/lib/mongoid/copyable.rb +1 -1
- data/lib/mongoid/criteria/findable.rb +1 -1
- data/lib/mongoid/criteria/queryable/expandable.rb +0 -24
- data/lib/mongoid/criteria/queryable/extensions/boolean.rb +1 -1
- data/lib/mongoid/criteria/queryable/extensions.rb +0 -4
- data/lib/mongoid/criteria/queryable/mergeable.rb +46 -20
- data/lib/mongoid/criteria/queryable/selectable.rb +10 -10
- data/lib/mongoid/criteria/queryable/storable.rb +4 -4
- data/lib/mongoid/criteria.rb +5 -6
- data/lib/mongoid/document.rb +3 -18
- data/lib/mongoid/errors/delete_restriction.rb +8 -9
- data/lib/mongoid/errors/mongoid_error.rb +1 -1
- data/lib/mongoid/errors.rb +0 -2
- data/lib/mongoid/evolvable.rb +1 -1
- data/lib/mongoid/extensions/boolean.rb +1 -2
- data/lib/mongoid/extensions/false_class.rb +1 -1
- data/lib/mongoid/extensions/hash.rb +2 -2
- data/lib/mongoid/extensions/true_class.rb +1 -1
- data/lib/mongoid/fields.rb +43 -5
- data/lib/mongoid/inspectable.rb +1 -1
- data/lib/mongoid/interceptable.rb +1 -1
- 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/expression.rb +4 -0
- data/lib/mongoid/matcher/field_operator.rb +6 -0
- data/lib/mongoid/matcher/mod.rb +17 -0
- data/lib/mongoid/matcher/type.rb +99 -0
- data/lib/mongoid/matcher.rb +7 -0
- data/lib/mongoid/persistable/deletable.rb +1 -2
- data/lib/mongoid/persistable/destroyable.rb +8 -2
- data/lib/mongoid/persistable/updatable.rb +27 -2
- data/lib/mongoid/persistence_context.rb +1 -3
- data/lib/mongoid/query_cache.rb +36 -40
- data/lib/mongoid/selectable.rb +5 -7
- data/lib/mongoid/shardable.rb +21 -5
- data/lib/mongoid/tasks/database.rb +1 -1
- data/lib/mongoid/touchable.rb +23 -4
- data/lib/mongoid/validatable/associated.rb +1 -1
- data/lib/mongoid/validatable/presence.rb +3 -3
- data/lib/mongoid/validatable/uniqueness.rb +1 -1
- data/lib/mongoid/version.rb +1 -1
- data/lib/mongoid.rb +0 -1
- data/lib/rails/generators/mongoid/config/templates/mongoid.yml +1 -1
- data/spec/integration/app_spec.rb +0 -3
- data/spec/integration/associations/embeds_many_spec.rb +44 -0
- data/spec/integration/associations/has_one_spec.rb +48 -0
- data/spec/integration/criteria/date_field_spec.rb +1 -1
- data/spec/integration/document_spec.rb +9 -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/in.yml +16 -0
- data/spec/integration/matcher_operator_data/mod.yml +55 -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 +40 -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/stringified_symbol_field_spec.rb +2 -2
- data/spec/lite_spec_helper.rb +2 -0
- data/spec/mongoid/association/depending_spec.rb +391 -352
- data/spec/mongoid/association/embedded/embeds_many/proxy_spec.rb +4 -17
- data/spec/mongoid/association/nested/one_spec.rb +18 -14
- data/spec/mongoid/association/referenced/belongs_to/proxy_spec.rb +25 -25
- data/spec/mongoid/association/referenced/belongs_to_query_spec.rb +0 -20
- data/spec/mongoid/association/referenced/has_and_belongs_to_many/binding_spec.rb +1 -1
- data/spec/mongoid/association/referenced/has_many/binding_spec.rb +1 -1
- data/spec/mongoid/association/referenced/has_many/enumerable_spec.rb +1 -1
- data/spec/mongoid/association/referenced/has_many_models.rb +0 -17
- data/spec/mongoid/association/referenced/has_one_models.rb +8 -0
- data/spec/mongoid/atomic/paths_spec.rb +64 -12
- 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 +41 -0
- data/spec/mongoid/attributes_spec.rb +98 -6
- data/spec/mongoid/clients/factory_spec.rb +51 -9
- data/spec/mongoid/clients/options_spec.rb +3 -11
- data/spec/mongoid/config/environment_spec.rb +8 -86
- data/spec/mongoid/config_spec.rb +32 -0
- data/spec/mongoid/contextual/atomic_spec.rb +25 -64
- data/spec/mongoid/contextual/geo_near_spec.rb +1 -1
- data/spec/mongoid/contextual/mongo_spec.rb +2 -2
- data/spec/mongoid/criteria/modifiable_spec.rb +1 -1
- data/spec/mongoid/criteria/queryable/expandable_spec.rb +0 -73
- data/spec/mongoid/criteria/queryable/extensions/boolean_spec.rb +1 -1
- data/spec/mongoid/criteria/queryable/mergeable_spec.rb +105 -7
- data/spec/mongoid/criteria/queryable/selectable_logical_spec.rb +229 -24
- data/spec/mongoid/criteria/queryable/selectable_shared_examples.rb +39 -0
- data/spec/mongoid/criteria/queryable/selectable_spec.rb +1 -565
- data/spec/mongoid/criteria/queryable/selectable_where_spec.rb +590 -0
- data/spec/mongoid/criteria_projection_spec.rb +411 -0
- data/spec/mongoid/criteria_spec.rb +0 -279
- data/spec/mongoid/document_query_spec.rb +0 -51
- data/spec/mongoid/document_spec.rb +14 -34
- data/spec/mongoid/errors/delete_restriction_spec.rb +1 -1
- data/spec/mongoid/errors/mongoid_error_spec.rb +8 -20
- data/spec/mongoid/extensions/false_class_spec.rb +1 -1
- data/spec/mongoid/extensions/string_spec.rb +5 -5
- data/spec/mongoid/extensions/true_class_spec.rb +1 -1
- data/spec/mongoid/fields/localized_spec.rb +4 -4
- data/spec/mongoid/fields_spec.rb +4 -4
- data/spec/mongoid/inspectable_spec.rb +12 -4
- data/spec/mongoid/persistable/deletable_spec.rb +175 -1
- data/spec/mongoid/persistable/destroyable_spec.rb +191 -3
- data/spec/mongoid/persistable/savable_spec.rb +3 -5
- data/spec/mongoid/persistable/updatable_spec.rb +0 -2
- data/spec/mongoid/persistable/upsertable_spec.rb +1 -1
- data/spec/mongoid/persistable_spec.rb +2 -2
- data/spec/mongoid/query_cache_middleware_spec.rb +8 -0
- data/spec/mongoid/query_cache_spec.rb +0 -24
- data/spec/mongoid/reloadable_spec.rb +18 -1
- data/spec/mongoid/shardable_spec.rb +44 -0
- data/spec/mongoid/touchable_spec.rb +104 -16
- data/spec/mongoid/touchable_spec_models.rb +52 -0
- data/spec/mongoid/validatable_spec.rb +1 -1
- data/spec/shared/lib/mrss/cluster_config.rb +3 -8
- data/spec/shared/lib/mrss/constraints.rb +10 -41
- data/spec/shared/lib/mrss/docker_runner.rb +1 -7
- data/spec/shared/lib/mrss/server_version_registry.rb +12 -17
- data/spec/shared/lib/mrss/spec_organizer.rb +1 -18
- data/spec/shared/share/Dockerfile.erb +33 -125
- data/spec/shared/shlib/server.sh +23 -100
- data/spec/shared/shlib/set_env.sh +1 -4
- data/spec/spec_helper.rb +7 -3
- data/spec/support/client_registry.rb +9 -0
- data/spec/support/models/address.rb +0 -4
- data/spec/support/models/bolt.rb +8 -0
- data/spec/support/models/hole.rb +13 -0
- data/spec/support/models/mop.rb +0 -1
- data/spec/support/models/nut.rb +8 -0
- data/spec/support/models/person.rb +6 -9
- data/spec/support/models/sealer.rb +8 -0
- data/spec/support/models/shirt.rb +12 -0
- data/spec/support/models/spacer.rb +8 -0
- data/spec/support/models/threadlocker.rb +8 -0
- data/spec/support/models/washer.rb +8 -0
- data.tar.gz.sig +0 -0
- metadata +609 -545
- metadata.gz.sig +0 -0
- data/lib/mongoid/errors/empty_config_file.rb +0 -26
- data/lib/mongoid/errors/invalid_config_file.rb +0 -26
- data/spec/integration/contextual/empty_spec.rb +0 -142
- data/spec/mongoid/errors/invalid_config_file_spec.rb +0 -32
- data/spec/shared/bin/s3-copy +0 -45
- data/spec/shared/bin/s3-upload +0 -69
- data/spec/shared/lib/mrss/event_subscriber.rb +0 -200
- data/spec/shared/share/haproxy-1.conf +0 -16
- data/spec/shared/share/haproxy-2.conf +0 -17
- data/spec/support/cluster_config.rb +0 -158
data/spec/shared/shlib/server.sh
CHANGED
@@ -10,21 +10,21 @@ set_fcv() {
|
|
10
10
|
|
11
11
|
add_uri_option() {
|
12
12
|
opt=$1
|
13
|
-
|
13
|
+
|
14
14
|
if ! echo $MONGODB_URI |sed -e s,//,, |grep -q /; then
|
15
15
|
MONGODB_URI="$MONGODB_URI/"
|
16
16
|
fi
|
17
|
-
|
17
|
+
|
18
18
|
if ! echo $MONGODB_URI |grep -q '?'; then
|
19
19
|
MONGODB_URI="$MONGODB_URI?"
|
20
20
|
fi
|
21
|
-
|
21
|
+
|
22
22
|
MONGODB_URI="$MONGODB_URI&$opt"
|
23
23
|
}
|
24
24
|
|
25
25
|
prepare_server() {
|
26
26
|
arch=$1
|
27
|
-
|
27
|
+
|
28
28
|
if test -n "$USE_OPT_MONGODB"; then
|
29
29
|
export BINDIR=/opt/mongodb/bin
|
30
30
|
export PATH=$BINDIR:$PATH
|
@@ -39,7 +39,7 @@ prepare_server() {
|
|
39
39
|
else
|
40
40
|
download_version="$MONGODB_VERSION"
|
41
41
|
fi
|
42
|
-
|
42
|
+
|
43
43
|
url=`$(dirname $0)/get-mongodb-download-url $download_version $arch`
|
44
44
|
|
45
45
|
prepare_server_from_url $url
|
@@ -80,7 +80,7 @@ install_mlaunch_pip() {
|
|
80
80
|
# mlaunch is preinstalled in the docker image, do not install it here
|
81
81
|
return
|
82
82
|
fi
|
83
|
-
|
83
|
+
|
84
84
|
python -V || true
|
85
85
|
python3 -V || true
|
86
86
|
pythonpath="$MONGO_ORCHESTRATION_HOME"/python
|
@@ -96,20 +96,20 @@ install_mlaunch_git() {
|
|
96
96
|
python3 -V || true
|
97
97
|
which pip || true
|
98
98
|
which pip3 || true
|
99
|
-
|
99
|
+
|
100
100
|
if false; then
|
101
101
|
if ! virtualenv --version; then
|
102
102
|
python3 `which pip3` install --user virtualenv
|
103
103
|
export PATH=$HOME/.local/bin:$PATH
|
104
104
|
virtualenv --version
|
105
105
|
fi
|
106
|
-
|
106
|
+
|
107
107
|
venvpath="$MONGO_ORCHESTRATION_HOME"/venv
|
108
108
|
virtualenv -p python3 $venvpath
|
109
109
|
. $venvpath/bin/activate
|
110
|
-
|
110
|
+
|
111
111
|
pip3 install psutil pymongo
|
112
|
-
|
112
|
+
|
113
113
|
git clone $repo mlaunch
|
114
114
|
cd mlaunch
|
115
115
|
git checkout origin/$branch
|
@@ -118,13 +118,13 @@ install_mlaunch_git() {
|
|
118
118
|
else
|
119
119
|
pip install --user 'virtualenv==13'
|
120
120
|
export PATH=$HOME/.local/bin:$PATH
|
121
|
-
|
121
|
+
|
122
122
|
venvpath="$MONGO_ORCHESTRATION_HOME"/venv
|
123
123
|
virtualenv $venvpath
|
124
124
|
. $venvpath/bin/activate
|
125
|
-
|
125
|
+
|
126
126
|
pip install psutil pymongo
|
127
|
-
|
127
|
+
|
128
128
|
git clone $repo mlaunch
|
129
129
|
(cd mlaunch &&
|
130
130
|
git checkout origin/$branch &&
|
@@ -133,32 +133,24 @@ install_mlaunch_git() {
|
|
133
133
|
fi
|
134
134
|
}
|
135
135
|
|
136
|
-
# This function sets followong global variables:
|
137
|
-
# server_cert_path
|
138
|
-
# server_ca_path
|
139
|
-
# server_client_cert_path
|
140
|
-
#
|
141
|
-
# These variables are used later to connect to processes via mongo client.
|
142
136
|
calculate_server_args() {
|
143
137
|
local mongo_version=`echo $MONGODB_VERSION |tr -d .`
|
144
|
-
|
138
|
+
|
145
139
|
if test -z "$mongo_version"; then
|
146
140
|
echo "$MONGODB_VERSION must be set and not contain only dots" 1>&2
|
147
141
|
exit 3
|
148
142
|
fi
|
149
|
-
|
143
|
+
|
150
144
|
if test $mongo_version = latest; then
|
151
145
|
mongo_version=49
|
152
146
|
fi
|
153
147
|
|
154
148
|
local args="--setParameter enableTestCommands=1"
|
155
|
-
|
156
|
-
if test $mongo_version -ge
|
157
|
-
args="$args --setParameter acceptApiVersion2=1"
|
158
|
-
elif test $mongo_version -ge 47; then
|
149
|
+
|
150
|
+
if test $mongo_version -ge 47; then
|
159
151
|
args="$args --setParameter acceptAPIVersion2=1"
|
160
152
|
fi
|
161
|
-
|
153
|
+
|
162
154
|
# diagnosticDataCollectionEnabled is a mongod-only parameter on server 3.2,
|
163
155
|
# and mlaunch does not support specifying mongod-only parameters:
|
164
156
|
# https://github.com/rueckstiess/mtools/issues/696
|
@@ -168,31 +160,15 @@ calculate_server_args() {
|
|
168
160
|
fi
|
169
161
|
local uri_options=
|
170
162
|
if test "$TOPOLOGY" = replica-set; then
|
171
|
-
args="$args --replicaset --name
|
163
|
+
args="$args --replicaset --name ruby-driver-rs --nodes 2 --arbiter"
|
172
164
|
export HAVE_ARBITER=1
|
173
165
|
elif test "$TOPOLOGY" = sharded-cluster; then
|
174
|
-
args="$args --replicaset --nodes 2 --sharded 1 --name
|
166
|
+
args="$args --replicaset --nodes 2 --sharded 1 --name ruby-driver-rs"
|
175
167
|
if test -z "$SINGLE_MONGOS"; then
|
176
168
|
args="$args --mongos 2"
|
177
169
|
fi
|
178
|
-
elif test "$TOPOLOGY" = standalone; then
|
179
|
-
args="$args --single"
|
180
|
-
elif test "$TOPOLOGY" = load-balanced; then
|
181
|
-
args="$args --replicaset --nodes 2 --sharded 1 --name test-rs --port 27117"
|
182
|
-
if test -z "$MRSS_ROOT"; then
|
183
|
-
echo "Please set MRSS_ROOT" 1>&2
|
184
|
-
exit 2
|
185
|
-
fi
|
186
|
-
if test -n "$SINGLE_MONGOS"; then
|
187
|
-
haproxy_config=$MRSS_ROOT/share/haproxy-1.conf
|
188
|
-
else
|
189
|
-
args="$args --mongos 2"
|
190
|
-
haproxy_config=$MRSS_ROOT/share/haproxy-2.conf
|
191
|
-
fi
|
192
|
-
uri_options="$uri_options&loadBalanced=true"
|
193
170
|
else
|
194
|
-
|
195
|
-
exit 1
|
171
|
+
args="$args --single"
|
196
172
|
fi
|
197
173
|
if test -n "$MMAPV1"; then
|
198
174
|
args="$args --storageEngine mmapv1 --smallfiles --noprealloc"
|
@@ -215,6 +191,7 @@ calculate_server_args() {
|
|
215
191
|
fi
|
216
192
|
fi
|
217
193
|
|
194
|
+
local server_cert_path server_ca_path server_client_cert_path
|
218
195
|
if test "$SSL" = ssl || test -n "$OCSP_ALGORITHM"; then
|
219
196
|
if test -n "$OCSP_ALGORITHM"; then
|
220
197
|
if test "$OCSP_MUST_STAPLE" = 1; then
|
@@ -293,7 +270,7 @@ calculate_server_args() {
|
|
293
270
|
ocsp_args="$ocsp_args --fault $OCSP_STATUS"
|
294
271
|
fi
|
295
272
|
fi
|
296
|
-
|
273
|
+
|
297
274
|
OCSP_ARGS="$ocsp_args"
|
298
275
|
SERVER_ARGS="$args"
|
299
276
|
URI_OPTIONS="$uri_options"
|
@@ -310,58 +287,4 @@ launch_ocsp_mock() {
|
|
310
287
|
launch_server() {
|
311
288
|
local dbdir="$1"
|
312
289
|
python -m mtools.mlaunch.mlaunch --dir "$dbdir" --binarypath "$BINDIR" $SERVER_ARGS
|
313
|
-
|
314
|
-
if test "$TOPOLOGY" = sharded-cluster && test $MONGODB_VERSION = 3.6; then
|
315
|
-
# On 3.6 server the sessions collection is not immediately available,
|
316
|
-
# so we run the refreshLogicalSessionCacheNow command on the config server
|
317
|
-
# and again on each mongos in order for the mongoses
|
318
|
-
# to correctly report logicalSessionTimeoutMinutes.
|
319
|
-
mongos_regex="\s*mongos\s+([0-9]+)\s+running\s+[0-9]+"
|
320
|
-
config_server_regex="\s*config\sserver\s+([0-9]+)\s+running\s+[0-9]+"
|
321
|
-
config_server=""
|
322
|
-
mongoses=()
|
323
|
-
if test "$AUTH" = auth
|
324
|
-
then
|
325
|
-
base_url="mongodb://bob:pwd123@localhost"
|
326
|
-
else
|
327
|
-
base_url="mongodb://localhost"
|
328
|
-
fi
|
329
|
-
if test "$SSL" = "ssl"
|
330
|
-
then
|
331
|
-
mongo_command="${BINDIR}/mongo --ssl --sslPEMKeyFile $server_cert_path --sslCAFile $server_ca_path"
|
332
|
-
else
|
333
|
-
mongo_command="${BINDIR}/mongo"
|
334
|
-
fi
|
335
|
-
|
336
|
-
while read -r line
|
337
|
-
do
|
338
|
-
if [[ $line =~ $config_server_regex ]]
|
339
|
-
then
|
340
|
-
port="${BASH_REMATCH[1]}"
|
341
|
-
config_server="${base_url}:${port}"
|
342
|
-
fi
|
343
|
-
if [[ $line =~ $mongos_regex ]]
|
344
|
-
then
|
345
|
-
port="${BASH_REMATCH[1]}"
|
346
|
-
mongoses+=("${base_url}:${port}")
|
347
|
-
fi
|
348
|
-
done < <(python -m mtools.mlaunch.mlaunch list --dir "$dbdir" --binarypath "$BINDIR")
|
349
|
-
|
350
|
-
if [ -n "$config_server" ]; then
|
351
|
-
${mongo_command} "$config_server" --eval 'db.adminCommand("refreshLogicalSessionCacheNow")'
|
352
|
-
for mongos in ${mongoses[*]}
|
353
|
-
do
|
354
|
-
${mongo_command} "$mongos" --eval 'db.adminCommand("refreshLogicalSessionCacheNow")'
|
355
|
-
done
|
356
|
-
fi
|
357
|
-
fi
|
358
|
-
|
359
|
-
if test "$TOPOLOGY" = load-balanced; then
|
360
|
-
if test -z "$haproxy_config"; then
|
361
|
-
echo haproxy_config should have been set 1>&2
|
362
|
-
exit 3
|
363
|
-
fi
|
364
|
-
|
365
|
-
haproxy -D -f $haproxy_config -p $mongodb_dir/haproxy.pid
|
366
|
-
fi
|
367
290
|
}
|
@@ -68,12 +68,9 @@ set_env_ruby() {
|
|
68
68
|
export PATH=`pwd`/ruby-head/bin:`pwd`/ruby-head/lib/ruby/gems/2.6.0/bin:$PATH
|
69
69
|
ruby --version
|
70
70
|
ruby --version |grep dev
|
71
|
-
elif test "$SYSTEM_RUBY" = 1; then
|
72
|
-
# Nothing
|
73
|
-
:
|
74
71
|
else
|
75
72
|
if test "$USE_OPT_TOOLCHAIN" = 1; then
|
76
|
-
#
|
73
|
+
# nothing, also PATH is already set
|
77
74
|
:
|
78
75
|
elif true; then
|
79
76
|
|
data/spec/spec_helper.rb
CHANGED
@@ -29,13 +29,17 @@ def database_id_alt
|
|
29
29
|
"mongoid_test_alt"
|
30
30
|
end
|
31
31
|
|
32
|
+
require 'mrss/cluster_config'
|
33
|
+
require 'support/client_registry'
|
34
|
+
require 'mrss/constraints'
|
35
|
+
|
36
|
+
ClusterConfig = Mrss::ClusterConfig
|
37
|
+
|
32
38
|
require 'support/authorization'
|
33
39
|
require 'support/expectations'
|
34
40
|
require 'support/helpers'
|
35
41
|
require 'support/macros'
|
36
|
-
require 'support/cluster_config'
|
37
42
|
require 'support/constraints'
|
38
|
-
require 'mrss/constraints'
|
39
43
|
|
40
44
|
# Give MongoDB servers time to start up in CI environments
|
41
45
|
if SpecConfig.instance.ci?
|
@@ -43,7 +47,7 @@ if SpecConfig.instance.ci?
|
|
43
47
|
client = Mongo::Client.new(SpecConfig.instance.addresses)
|
44
48
|
while starting
|
45
49
|
begin
|
46
|
-
client.command(
|
50
|
+
client.command(Mongo::Server::Monitor::Connection::ISMASTER)
|
47
51
|
break
|
48
52
|
rescue Mongo::Error::OperationFailure => e
|
49
53
|
sleep(2)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
class Hole
|
5
|
+
include Mongoid::Document
|
6
|
+
|
7
|
+
has_one :bolt, dependent: :destroy
|
8
|
+
has_one :threadlocker, dependent: :delete_all
|
9
|
+
has_one :sealer, dependent: :restrict_with_exception
|
10
|
+
has_many :nuts, dependent: :destroy
|
11
|
+
has_many :washers, dependent: :delete_all
|
12
|
+
has_many :spacers, dependent: :restrict_with_exception
|
13
|
+
end
|
data/spec/support/models/mop.rb
CHANGED
@@ -136,10 +136,6 @@ class Person
|
|
136
136
|
scope :without_ssn, ->{ without(:ssn) }
|
137
137
|
scope :search, ->(query){ any_of({ title: query }) }
|
138
138
|
|
139
|
-
def self.older_than(age:)
|
140
|
-
where(:age.gt => age)
|
141
|
-
end
|
142
|
-
|
143
139
|
def score_with_rescoring=(score)
|
144
140
|
@rescored = score.to_i + 20
|
145
141
|
self.score_without_rescoring = score
|
@@ -210,15 +206,16 @@ class Person
|
|
210
206
|
self.map_with_default["key"] = value
|
211
207
|
end
|
212
208
|
|
213
|
-
def set_personal_data(ssn:, age:)
|
214
|
-
self.ssn = ssn
|
215
|
-
self.age = age
|
216
|
-
end
|
217
|
-
|
218
209
|
reset_callbacks(:validate)
|
219
210
|
reset_callbacks(:create)
|
220
211
|
reset_callbacks(:save)
|
221
212
|
reset_callbacks(:destroy)
|
213
|
+
|
214
|
+
private
|
215
|
+
|
216
|
+
def secret_name
|
217
|
+
"secret"
|
218
|
+
end
|
222
219
|
end
|
223
220
|
|
224
221
|
require "support/models/doctor"
|
data.tar.gz.sig
CHANGED
Binary file
|