lhs 15.2.2 → 15.2.3.pre.favorites.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lhs/concerns/record/request.rb +6 -2
- data/lib/lhs/version.rb +1 -1
- data/spec/concerns/record/request_spec.rb +36 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f38ffdbc961e4017dc1d0d69061fd095dfb14bcd
|
4
|
+
data.tar.gz: 260c6c9c52daea2d9d87465d6b64e6454b0fff38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4adb473a75f4bdb1fb98d79a64ce3f520d18f4ed8d1e491e11d364d4d2e144ac7b85928d35b17e7b40bcf293f388325bd24fc0046dcbd985ef48c9f45d00a6f4
|
7
|
+
data.tar.gz: 9b62a3f7cea553e4b0602f4148db60ab6feb4a704ea90cf4d64ffc732bced80f21d95d106207dfbd41f96332bea6339edcaba1206c3a4dabfa9152bb1784c401
|
@@ -267,14 +267,18 @@ class LHS::Record
|
|
267
267
|
|
268
268
|
def load_and_merge_set_of_paginated_collections!(data, options)
|
269
269
|
options_for_this_batch = []
|
270
|
+
data_record = data._record
|
271
|
+
data = data.compact
|
270
272
|
options.compact.each_with_index do |_, index|
|
271
273
|
record = data[index]._record
|
272
274
|
pagination = record.pagination(data[index])
|
273
275
|
next if pagination.pages_left.zero?
|
274
276
|
options_for_this_batch.push(options_for_next_batch(record, pagination, options[index], data[index]))
|
275
277
|
end
|
276
|
-
|
277
|
-
|
278
|
+
if data_record.present?
|
279
|
+
data_record.request(options_for_this_batch.flatten).each do |batch_data|
|
280
|
+
merge_batch_data_with_parent!(batch_data, batch_data._request.options[:parent_data])
|
281
|
+
end
|
278
282
|
end
|
279
283
|
end
|
280
284
|
|
data/lib/lhs/version.rb
CHANGED
@@ -73,4 +73,40 @@ describe LHS::Record::Request do
|
|
73
73
|
params: { limit: 100 })
|
74
74
|
end
|
75
75
|
end
|
76
|
+
|
77
|
+
describe 'load_and_merge_set_of_paginated_collections!' do
|
78
|
+
let(:options) do
|
79
|
+
[
|
80
|
+
{
|
81
|
+
url: 'http://localhost:3000/test/resource?abc=def&limit=1&offset=3&test=1',
|
82
|
+
all: true,
|
83
|
+
auth: { bearer: 'xxx' },
|
84
|
+
params: { limit: 100 }
|
85
|
+
},
|
86
|
+
nil,
|
87
|
+
{
|
88
|
+
url: 'http://localhost:3000/test/resource?abc=def&limit=1&offset=3&test=3',
|
89
|
+
all: true,
|
90
|
+
auth: { bearer: 'xxx' },
|
91
|
+
params: { limit: 100 }
|
92
|
+
},
|
93
|
+
]
|
94
|
+
end
|
95
|
+
|
96
|
+
let(:data_array) do
|
97
|
+
[
|
98
|
+
LHS::Record.new,
|
99
|
+
nil,
|
100
|
+
LHS::Record.new,
|
101
|
+
]
|
102
|
+
end
|
103
|
+
|
104
|
+
let(:data) do
|
105
|
+
LHS::Record.new(data_array)
|
106
|
+
end
|
107
|
+
|
108
|
+
it 'does not raise an error when data has nil objects' do
|
109
|
+
expect(subject.send(:load_and_merge_set_of_paginated_collections!, data, options)).to_not be_nil
|
110
|
+
end
|
111
|
+
end
|
76
112
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 15.2.
|
4
|
+
version: 15.2.3.pre.favorites.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhs/graphs/contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lhc
|
@@ -431,13 +431,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
431
431
|
version: 2.3.0
|
432
432
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
433
433
|
requirements:
|
434
|
-
- - "
|
434
|
+
- - ">"
|
435
435
|
- !ruby/object:Gem::Version
|
436
|
-
version:
|
436
|
+
version: 1.3.1
|
437
437
|
requirements:
|
438
438
|
- Ruby >= 2.3.0
|
439
439
|
rubyforge_project:
|
440
|
-
rubygems_version: 2.
|
440
|
+
rubygems_version: 2.5.1
|
441
441
|
signing_key:
|
442
442
|
specification_version: 4
|
443
443
|
summary: Rails gem providing an easy, active-record-like interface for http json services
|