lhs 19.8.1 → 19.8.2
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 +1 -1
- data/lib/lhs/version.rb +1 -1
- data/spec/record/includes_all_spec.rb +58 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e57e3afbbffbdd6fdbcc8b64a947daae97b5faa5975ae8fe29b6b77d87b0d47
|
4
|
+
data.tar.gz: 5d8363f9dcbd226f60428e6344967ef2369639fd36544b7a6d9112d5058b8d31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f7ae19794cade9f046731c0c6cc948a87b8a04bada44e14c52853600b78c47f6ecfb53bc2bedbb16918cb0cf2788e3ac780873ebbeebbad544eb504494464aa
|
7
|
+
data.tar.gz: b8092ac44ed946248fa686e95873ce841cd1b38dbebbc41f7547037840b56e8c8c5d168c1866382e9f6e6eb51c181e43f407febe9d5ff1b476b1df3a063f326e
|
@@ -84,7 +84,7 @@ class LHS::Record
|
|
84
84
|
def values_from_get_params(url, options)
|
85
85
|
uri = parse_uri(url, options)
|
86
86
|
return {} if uri.query.blank?
|
87
|
-
params = Rack::Utils.parse_nested_query(uri.query)
|
87
|
+
params = Rack::Utils.parse_nested_query(uri.query).deep_symbolize_keys
|
88
88
|
params
|
89
89
|
end
|
90
90
|
|
data/lib/lhs/version.rb
CHANGED
@@ -632,4 +632,62 @@ describe LHS::Record do
|
|
632
632
|
expect(place.customer.addresses.map(&:no)).to eq [1, 2]
|
633
633
|
end
|
634
634
|
end
|
635
|
+
|
636
|
+
context 'does not fail including all linked resources' do
|
637
|
+
|
638
|
+
before do
|
639
|
+
class CustomerOnboardingToken < LHS::Record
|
640
|
+
endpoint 'https://token/{id}'
|
641
|
+
end
|
642
|
+
|
643
|
+
class Place < LHS::Record
|
644
|
+
endpoint 'https://places/{id}'
|
645
|
+
end
|
646
|
+
|
647
|
+
class AvailableAsset < LHS::Record
|
648
|
+
endpoint 'https://assets'
|
649
|
+
end
|
650
|
+
|
651
|
+
stub_request(:get, 'https://token/1')
|
652
|
+
.to_return(
|
653
|
+
body: {
|
654
|
+
places: [{ href: 'https://places/1' }]
|
655
|
+
}.to_json
|
656
|
+
)
|
657
|
+
|
658
|
+
stub_request(:get, 'https://places/1?limit=100')
|
659
|
+
.to_return(
|
660
|
+
body: {
|
661
|
+
available_assets: { 'href': 'https://assets?limit=10&offset=0' }
|
662
|
+
}.to_json
|
663
|
+
)
|
664
|
+
|
665
|
+
stub_request(:get, 'https://assets?limit=10&offset=0')
|
666
|
+
.to_return(
|
667
|
+
body: {
|
668
|
+
items: 10.times.map { { asset_code: 'CATEGORIES' } },
|
669
|
+
total: 17,
|
670
|
+
offset: 0,
|
671
|
+
limit: 10
|
672
|
+
}.to_json
|
673
|
+
)
|
674
|
+
|
675
|
+
stub_request(:get, 'https://assets?limit=10&offset=10')
|
676
|
+
.to_return(
|
677
|
+
body: {
|
678
|
+
items: 7.times.map { { asset_code: 'CATEGORIES' } },
|
679
|
+
total: 17,
|
680
|
+
offset: 0,
|
681
|
+
limit: 10
|
682
|
+
}.to_json
|
683
|
+
)
|
684
|
+
end
|
685
|
+
|
686
|
+
it 'includes a collection trough a single item without exceptions' do
|
687
|
+
token = CustomerOnboardingToken
|
688
|
+
.includes_all(places: :available_assets)
|
689
|
+
.find(1)
|
690
|
+
expect(token.places.first.available_assets.length).to eq 17
|
691
|
+
end
|
692
|
+
end
|
635
693
|
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: 19.8.
|
4
|
+
version: 19.8.2
|
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: 2019-07-
|
11
|
+
date: 2019-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|