lhs 15.2.2 → 15.2.3.pre.favorites.1

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: 846f2dcb99c6c1a4b153e1d1b998c51c32f2c82b
4
- data.tar.gz: d2e4703f188e3e60611ca2c819275d9d6daa0a3c
3
+ metadata.gz: f38ffdbc961e4017dc1d0d69061fd095dfb14bcd
4
+ data.tar.gz: 260c6c9c52daea2d9d87465d6b64e6454b0fff38
5
5
  SHA512:
6
- metadata.gz: aad4ca989ca9c836050891eb6b3223c4598fa1319a56d5f21ada0e76c8e59224a677ced8895c8aea5920e4fec3b70c53c1a271cbf928dc0653cfbe32b42a42d4
7
- data.tar.gz: 2ced9df1e871c81eb07c45123c4af13e6afea3dc7cc4e14257949d25d5e5e7dcdc28dea5633b693aa8e7a9585aa1f14861168fcf924e50010fc6589b346a89db
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
- data._record.request(options_for_this_batch.flatten).each do |batch_data|
277
- merge_batch_data_with_parent!(batch_data, batch_data._request.options[:parent_data])
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
 
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = '15.2.2'
2
+ VERSION = '15.2.3-favorites.1'
3
3
  end
@@ -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.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-16 00:00:00.000000000 Z
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: '0'
436
+ version: 1.3.1
437
437
  requirements:
438
438
  - Ruby >= 2.3.0
439
439
  rubyforge_project:
440
- rubygems_version: 2.6.14
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