lhs 14.3.2 → 14.3.3
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 +4 -4
- data/lib/lhs/concerns/record/request.rb +1 -1
- data/lib/lhs/version.rb +1 -1
- data/spec/record/endpoint_options_spec.rb +22 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faac20a893bc5f0b14a162d5d2aa558c47d6939e
|
4
|
+
data.tar.gz: e821d49493af8481912155de04685e493125f6e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b2e761d4b8354dfc417c09f88b581c420773bad5206e7581f1e969f50cb661590a70776acef43ae84d753b3d7daabb08f31d42314f5eed82c14f84fbe3fce5a
|
7
|
+
data.tar.gz: 7804df813f9ed2e795c8323307a911d47b1eaaf5ec93a308cf1dc893ca2ac7a34a18504faecb0ab11c219c69ae24d32c5edfb713a477c4117d9392dc8a48d987
|
@@ -434,7 +434,7 @@ class LHS::Record
|
|
434
434
|
options[:ignored_errors] = ignored_errors if ignored_errors.present?
|
435
435
|
options[:params].deep_symbolize_keys! if options[:params]
|
436
436
|
options[:error_handler] = merge_error_handlers(options[:error_handler]) if options[:error_handler]
|
437
|
-
options = (endpoint.options || {}).
|
437
|
+
options = (endpoint.options || {}).deep_merge(options)
|
438
438
|
options[:url] = compute_url!(options[:params]) unless options.key?(:url)
|
439
439
|
merge_explicit_params!(options[:params])
|
440
440
|
options.delete(:params) if options[:params] && options[:params].empty?
|
data/lib/lhs/version.rb
CHANGED
@@ -17,5 +17,27 @@ describe LHS::Record do
|
|
17
17
|
stub_request(:get, "http://backend/v2/feedbacks/1").to_return(status: 200)
|
18
18
|
Record.find(1)
|
19
19
|
end
|
20
|
+
|
21
|
+
context 'deep merge endpoint options' do
|
22
|
+
|
23
|
+
before(:each) do
|
24
|
+
class Location < LHS::Record
|
25
|
+
endpoint 'http://uberall/locations', headers: { privateKey: '123' }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'deep merges options to not overwrite endpoint options' do
|
30
|
+
stub_request(:get, "http://uberall/locations")
|
31
|
+
.with(
|
32
|
+
headers: {
|
33
|
+
'Privatekey' => '123',
|
34
|
+
'Accept' => 'application/json'
|
35
|
+
}
|
36
|
+
)
|
37
|
+
.to_return(body: [].to_json)
|
38
|
+
|
39
|
+
Location.options(headers: { 'Accept' => 'application/json' }).fetch
|
40
|
+
end
|
41
|
+
end
|
20
42
|
end
|
21
43
|
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: 14.3.
|
4
|
+
version: 14.3.3
|
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: 2017-10-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lhc
|