lhs 14.6.0 → 14.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 077d421d6966d805ebcd502e5a0c093cc6bcf4a4
4
- data.tar.gz: c687c58f9bde359b6576812aa9eebd19b984c5cc
3
+ metadata.gz: 3f43fd239e54190457f35e2e29323351b6b84cb2
4
+ data.tar.gz: f10e41c0a91e351efd64118a350e550ea1ef1588
5
5
  SHA512:
6
- metadata.gz: a63875a01836b652d4b049df0c50b3c314fe2ff6306e37134e149defb1bdf1addc904455406991f974954c6de2ee0906c20205f4bd3ad4127fd583755c64afff
7
- data.tar.gz: 78388e5606346ecbb96d944cf25285e2fbbbecdb1b9d6647dac8c940646186ae7a5ec88574cf1ec2d42b164f9f7fc75588dd4927d7d4689719f2515b775b8341
6
+ metadata.gz: 904abacf42754b19152dd99d0ffd4de2099a9c17914245070ba10c66b8ed419c8d480461ad24bdef6f625170e1f5931e1dfe80e751f6b50b9ce09df69479629b
7
+ data.tar.gz: 0bd224d03ba35e16be38033722f072fb3f8adaf13f3ef56faf37edf78b55246c397f36c223bcdc117039f27d18a9707fe8fb0d8702b005173439c1147d0c733f
@@ -6,7 +6,7 @@ class LHS::Data
6
6
  extend ActiveSupport::Concern
7
7
 
8
8
  def becomes(klass)
9
- klass.new(_raw)
9
+ klass.new(LHS::Data.new(_raw, _parent, klass))
10
10
  end
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = '14.6.0'
2
+ VERSION = '14.6.1'
3
3
  end
@@ -20,15 +20,23 @@ describe LHS::Record do
20
20
  let(:location) { Location.find(1) }
21
21
  let(:listing) { location.listings.first }
22
22
 
23
- it 'casts the relation into the correct type' do
23
+ before(:each) do
24
24
  stub_request(:get, 'http://uberall/locations/1')
25
25
  .to_return(body: {
26
26
  listings: [{
27
27
  directory: { name: 'Instagram' }
28
28
  }]
29
29
  }.to_json)
30
+ end
31
+
32
+ it 'casts the relation into the correct type' do
30
33
  expect(listing).to be_kind_of(Listing)
31
34
  expect(listing.supported?).to eq true
32
35
  end
36
+
37
+ it 'keeps hirachy when casting it to another class on access' do
38
+ expect(listing._root._raw).to eq location._raw
39
+ expect(listing.parent.parent._raw).to eq location._raw
40
+ end
33
41
  end
34
42
  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.6.0
4
+ version: 14.6.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-10-23 00:00:00.000000000 Z
11
+ date: 2017-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lhc