mongoid 6.0.1 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed08df05221cb2fd51ee6873d0057b4966a5c0b8
4
- data.tar.gz: a741c71fcb479876d2ea795cecb20662732a2333
3
+ metadata.gz: a8b580a727a83dc18982a841d0b52cf35f5d0c0a
4
+ data.tar.gz: b27b04628096c9a288675eb3f467e06dd8d86d5a
5
5
  SHA512:
6
- metadata.gz: 0cae8bddd78b2ede9c0a8ace4ce8c468699e2a9f3b4377b3af9dde6948a83d911271e5425944ff12a385a56f4c3316f360a313933db558e801b76cb1b23ecd47
7
- data.tar.gz: 4611925c73babd6ec1b7b3297e764f78ecd3b49d8dea449dc43d45385151ca59b69dba0f8b454cd554583c4d5217fd1c24f83d7a16cddfd32e1e82611e7c0a95
6
+ metadata.gz: ebc9caddd2509267906d0560638c935f78bf2b88424cb0a5b9bd948f32dc072775053a98636979458810c01e9c444abe4e7c6484b48eafbfa982288821302b16
7
+ data.tar.gz: ff7dd1d52db6ec52a32c372f7d991e7821adaf0fc2404d9cde3b2c397df971b76a6fc273fe46d04f84976c56415886dd177b585b9071afedeac31de4617a02cb
@@ -1 +1,3 @@
1
- Wǻ�fJw������ �<L�����ڐ�5��>�������1R9$�nPK)�M#����v��GM��q�?��S��j��YJA����{_�������%45f-{Hy�;BO�_M�$,��@S*i�HI}�З�����] ���Dd~1���@��;����j}�����la���]~0��ob8-�����t�_h�:��f�jF��J��̀�R���T8)�w
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
- _key == '$in' ? new_val & old_val : old_val | new_val
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
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Mongoid
3
- VERSION = "6.0.1"
3
+ VERSION = "6.0.2"
4
4
  end
@@ -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.1
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-19 00:00:00.000000000 Z
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
- �ϭ���<iL�˶���`G�|�dw����l#��w� �S���b���a���!рu����\�SV�M2����VbA�$XIq[n��/h���Ğ\�/:�z6Q35�T���yIe����>Lp �����dY� +5����Ç��)��xC�ݔFG�-km��MK��v��h�lXO�q@�F�[�$,���������1�j�
2
- �J.)g�ג��a��
1
+ ��@3GO1����{��i{Uǀ��B}1m���\4`ż��)�/�$���x܉�+�Hw�#�l������tv��dҒ�ʕ^��=�G���9q0;Ȍ�N�-1}T��