lhs 12.0.0 → 12.0.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/endpoints.rb +2 -2
- data/lib/lhs/concerns/record/request.rb +1 -1
- data/lib/lhs/version.rb +1 -1
- data/spec/record/includes_all_spec.rb +39 -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: f6dd72496ffd697f998423f63eb040d12da20c75
|
4
|
+
data.tar.gz: 087da614313aa4626e2b0671a0071cdbc7c82922
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75374cd617e5b67ba372bdefc710e2f305b27e8639a5df27d4f21cd44cd93df14a13ab79d11ae2a333069a3686f16739e0b15298346d0cb860c8944d7a0cd8b5
|
7
|
+
data.tar.gz: 566ebd60a00e7e7a68486bd77bc6431678bd42df5abcd680e1e4d775c7b321d88ac33d097576330195ecb97705aa74a68224547c3663051c40717c2fa695459e
|
data/lib/lhs/version.rb
CHANGED
@@ -339,4 +339,43 @@ describe LHS::Record do
|
|
339
339
|
end
|
340
340
|
end
|
341
341
|
end
|
342
|
+
|
343
|
+
context 'Linked resources' do
|
344
|
+
before(:each) do
|
345
|
+
stub_request(:get, 'http://datastore/places/1/contracts?offset=0&limit=10')
|
346
|
+
.to_return(
|
347
|
+
body: {
|
348
|
+
href: "http://datastore/v2/places/1/contracts?offset=0&limit=10",
|
349
|
+
items: [{ href: "http://datastore/v2/contracts/1" }]
|
350
|
+
}.to_json
|
351
|
+
)
|
352
|
+
|
353
|
+
stub_request(:get, "http://datastore/v2/contracts/1")
|
354
|
+
.to_return(
|
355
|
+
body: {
|
356
|
+
customer: { name: 'Swisscom Directories AG' }
|
357
|
+
}.to_json
|
358
|
+
)
|
359
|
+
|
360
|
+
stub_request(:get, 'http://datastore/places/1?limit=1')
|
361
|
+
.to_return(
|
362
|
+
body: { href: 'http://datastore/places/1', contracts: { href: 'http://datastore/places/1/contracts?offset=0&limit=10' } }.to_json
|
363
|
+
)
|
364
|
+
|
365
|
+
class Place < LHS::Record
|
366
|
+
endpoint 'http://datastore/places/:id'
|
367
|
+
end
|
368
|
+
|
369
|
+
class Contract < LHS::Record
|
370
|
+
endpoint 'http://datastore/places/:place_id/contracts'
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
it 'does not use the root record endpoints when including nested records' do
|
375
|
+
place = Place
|
376
|
+
.includes_all(:contracts)
|
377
|
+
.find_by(id: 1)
|
378
|
+
expect(place.contracts.first.customer.name).to eq 'Swisscom Directories AG'
|
379
|
+
end
|
380
|
+
end
|
342
381
|
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: 12.0.
|
4
|
+
version: 12.0.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: 2017-
|
11
|
+
date: 2017-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lhc
|