lhs 6.7.1 → 6.7.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: fbd933665cec45ce1436c7269a629daff5434bed
4
- data.tar.gz: 442dcbe99d90e1c91b6b807edb8e8a0124da990a
3
+ metadata.gz: 68d9eea1eeef7f8711bc52a5f502889db86060f3
4
+ data.tar.gz: ace1d44c61822943f8d388abb1ca0729a539bd56
5
5
  SHA512:
6
- metadata.gz: edcd93be11865ee1291ec4d8800f264a257ab08ce5c3bd93da4157273595b5b446db30e1417cd45e8919b2b976fa02a30653599d8f710adbaac71b15f4e8162b
7
- data.tar.gz: 8293a74ec2da99923487e98f7ff51678c3c7273cf9366ccd4e09dfb32b076208158c48692ac467bff23738ac5f801afbee150a439f133b8658d78099f6a4eac5
6
+ metadata.gz: 036a2f4aec3cdba0aab5c5291187725740df70c8613e1651f9b371ef5f17e3908cc57465f461ea3bc1fa4fa873c746c3ec75488571052abb26ba06ea13891ce2
7
+ data.tar.gz: 0e307ed787e902e0b0b0c37f3665965ef52c8d1909d55cc3f6e95c0a66fe2ba38859b36482ecc275f407bad9f84b00e937b2f4e6f016bd1e33d1fc55eb286e88
@@ -20,3 +20,7 @@ Rails/OutputSafety:
20
20
 
21
21
  Style/SignalException:
22
22
  Enabled: false
23
+
24
+ Rails/DynamicFindBy:
25
+ Enabled: false
26
+
@@ -23,6 +23,7 @@ class LHS::Item < LHS::Proxy
23
23
  endpoint = record.find_endpoint(data)
24
24
  url = endpoint.compile(data)
25
25
  endpoint.remove_interpolated_params!(data)
26
+ options.merge!(endpoint.options.merge(options)) if endpoint.options
26
27
  end
27
28
 
28
29
  options = options.merge(method: :post, url: url, body: data.to_json)
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = "6.7.1"
2
+ VERSION = "6.7.2"
3
3
  end
@@ -20,6 +20,24 @@ describe LHS::Item do
20
20
  data[0]
21
21
  end
22
22
 
23
+ context 'endpoint options' do
24
+ let(:headers) { { 'X-Header' => 'VALUE' } }
25
+
26
+ before(:each) do
27
+ class RecordWithOptions < LHS::Record
28
+ endpoint 'http://datastore/records', headers: { 'X-Header' => 'VALUE' }
29
+ end
30
+ end
31
+
32
+ it 'considers end point options when saving' do
33
+ data = { name: 'Steve' }
34
+ stub_request(:post, "http://datastore/records")
35
+ .with(body: data.to_json, headers: headers)
36
+ .to_return(body: data.to_json)
37
+ RecordWithOptions.create!(data)
38
+ end
39
+ end
40
+
23
41
  context 'save' do
24
42
  it 'persists changes on the backend' do
25
43
  stub_request(:post, item.href).with(body: item._raw.merge(name: 'Steve').to_json)
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: 6.7.1
4
+ version: 6.7.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: 2016-10-11 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lhc