lhs 5.7.0 → 5.7.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/data/to_hash.rb +12 -0
- data/lib/lhs/data.rb +1 -0
- data/lib/lhs/version.rb +1 -1
- data/spec/record/to_hash_spec.rb +20 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8fe4ac73d6355f5299f3f30b469f2e13fb15bfe
|
4
|
+
data.tar.gz: fefa077f115710e969b0f09d5e82c0b9bde6e0dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 344f8f4704e193a8185f4f78a341afb80d160a59e52ae33845f8c9d8ee09f929aa2f3aa4401cd704a20e589316c7d425f8ad719e4d8b915849b3a28c654835c1
|
7
|
+
data.tar.gz: 79ea9e5130c14c4a0403ba11848f799d7f0d7015a4fea2b2a83c565981c223c686d16b617faa181f50cd26454a2aac2429b1b2a14e6127d5b8462eaf302e4d44
|
data/lib/lhs/data.rb
CHANGED
data/lib/lhs/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe LHS::Record do
|
4
|
+
before(:each) do
|
5
|
+
class Record < LHS::Record
|
6
|
+
endpoint 'http://datastore/records'
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:item) { { name: 'Thomas' } }
|
11
|
+
let(:body) { [item] }
|
12
|
+
|
13
|
+
it 'converts itself to hash' do
|
14
|
+
stub_request(:get, "http://datastore/records")
|
15
|
+
.to_return(body: body.to_json)
|
16
|
+
record = Record.where.first
|
17
|
+
expect(record.to_h).to eq item
|
18
|
+
expect(record.to_hash).to eq item
|
19
|
+
end
|
20
|
+
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: 5.7.
|
4
|
+
version: 5.7.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: 2016-07-
|
11
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lhc
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- lib/lhs/concerns/collection/internal_collection.rb
|
180
180
|
- lib/lhs/concerns/data/equality.rb
|
181
181
|
- lib/lhs/concerns/data/json.rb
|
182
|
+
- lib/lhs/concerns/data/to_hash.rb
|
182
183
|
- lib/lhs/concerns/item/destroy.rb
|
183
184
|
- lib/lhs/concerns/item/save.rb
|
184
185
|
- lib/lhs/concerns/item/update.rb
|
@@ -312,6 +313,7 @@ files:
|
|
312
313
|
- spec/record/save_spec.rb
|
313
314
|
- spec/record/scope_chains_spec.rb
|
314
315
|
- spec/record/select_spec.rb
|
316
|
+
- spec/record/to_hash_spec.rb
|
315
317
|
- spec/record/to_json_spec.rb
|
316
318
|
- spec/record/where_chains_spec.rb
|
317
319
|
- spec/record/where_spec.rb
|
@@ -453,6 +455,7 @@ test_files:
|
|
453
455
|
- spec/record/save_spec.rb
|
454
456
|
- spec/record/scope_chains_spec.rb
|
455
457
|
- spec/record/select_spec.rb
|
458
|
+
- spec/record/to_hash_spec.rb
|
456
459
|
- spec/record/to_json_spec.rb
|
457
460
|
- spec/record/where_chains_spec.rb
|
458
461
|
- spec/record/where_spec.rb
|