mongoid 6.0.1 → 6.0.2
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 +3 -1
- data.tar.gz.sig +0 -0
- data/lib/mongoid/criteria/queryable/selector.rb +17 -1
- data/lib/mongoid/version.rb +1 -1
- data/spec/mongoid/criteria/queryable/selector_spec.rb +21 -0
- metadata +2 -2
- metadata.gz.sig +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8b580a727a83dc18982a841d0b52cf35f5d0c0a
|
4
|
+
data.tar.gz: b27b04628096c9a288675eb3f467e06dd8d86d5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebc9caddd2509267906d0560638c935f78bf2b88424cb0a5b9bd948f32dc072775053a98636979458810c01e9c444abe4e7c6484b48eafbfa982288821302b16
|
7
|
+
data.tar.gz: ff7dd1d52db6ec52a32c372f7d991e7821adaf0fc2404d9cde3b2c397df971b76a6fc273fe46d04f84976c56415886dd177b585b9071afedeac31de4617a02cb
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
���ה��\�k�D|u&�ި:ͨ�fIZ���j�۳爑i��#A$U��F�� >w
|
2
|
+
Z7�ۻ&aZ9��0bC��,�AfZ��\Z{�e���_H(K~;ٕ���|�;C���Μ�����p��1d�RP!eC��`{>��!��}D��?���/B���w�Ŏ��~��C1楯y��H,��^p�Ņ��?���ޓ
|
3
|
+
ju8����3�Y�A�n<�?���Ky�ԟmb"iz5���'�ü�3�77@�$x����
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -21,7 +21,13 @@ module Mongoid
|
|
21
21
|
other.each_pair do |key, value|
|
22
22
|
if value.is_a?(Hash) && self[key.to_s].is_a?(Hash)
|
23
23
|
value = self[key.to_s].merge(value) do |_key, old_val, new_val|
|
24
|
-
|
24
|
+
if in?(_key)
|
25
|
+
new_val & old_val
|
26
|
+
elsif nin?(_key)
|
27
|
+
(old_val + new_val).uniq
|
28
|
+
else
|
29
|
+
new_val
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
27
33
|
if multi_selection?(key)
|
@@ -190,6 +196,16 @@ module Mongoid
|
|
190
196
|
def multi_value?(key)
|
191
197
|
key =~ /\$nin|\$in/
|
192
198
|
end
|
199
|
+
|
200
|
+
private
|
201
|
+
|
202
|
+
def in?(key)
|
203
|
+
key =~ /\$in/
|
204
|
+
end
|
205
|
+
|
206
|
+
def nin?(key)
|
207
|
+
key =~ /\$nin/
|
208
|
+
end
|
193
209
|
end
|
194
210
|
end
|
195
211
|
end
|
data/lib/mongoid/version.rb
CHANGED
@@ -135,6 +135,27 @@ describe Mongoid::Criteria::Queryable::Selector do
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
+
context 'when an object does not support the | operator' do
|
139
|
+
|
140
|
+
before do
|
141
|
+
selector['start'] = selection
|
142
|
+
selector.merge!(other)
|
143
|
+
end
|
144
|
+
|
145
|
+
let(:selection) do
|
146
|
+
{ '$lt' => Time.now }
|
147
|
+
end
|
148
|
+
|
149
|
+
let(:other) do
|
150
|
+
{ 'start' => selection, 'name' => 'test', }
|
151
|
+
end
|
152
|
+
|
153
|
+
it "merges" do
|
154
|
+
expect(selector['name']).to eq('test')
|
155
|
+
expect(selector['start']).to eq(selection)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
138
159
|
context "when the selector contains an $or" do
|
139
160
|
|
140
161
|
let(:initial) do
|
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: 6.0.
|
4
|
+
version: 6.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Durran Jordan
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
ZIvvwAhgCjVW5QCi2I1noxXLmtZ3XDawWu8kaGtu8giHXcwL3941m8hvFZ/Wr9Yi
|
31
31
|
JvcXJt2a4/JvwnIs2hmKuyfhZmB9HEE5wQQaCMnnC14=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2016-10-
|
33
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: activemodel
|
metadata.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
�J.)g�ג��a��
|
1
|
+
��@3�GO�1����{��i{Uǀ��B�}1�m���\4`ż��)�/�$���x܉�+�Hw�#�l������tv��dҒ�ʕ^��=�G���9�q0;Ȍ�N�-1}T��
|