lhs 6.7.0 → 6.7.1
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/chainable.rb +4 -0
- data/lib/lhs/version.rb +1 -1
- data/spec/record/find_by_chains_spec.rb +19 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbd933665cec45ce1436c7269a629daff5434bed
|
4
|
+
data.tar.gz: 442dcbe99d90e1c91b6b807edb8e8a0124da990a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edcd93be11865ee1291ec4d8800f264a257ab08ce5c3bd93da4157273595b5b446db30e1417cd45e8919b2b976fa02a30653599d8f710adbaac71b15f4e8162b
|
7
|
+
data.tar.gz: 8293a74ec2da99923487e98f7ff51678c3c7273cf9366ccd4e09dfb32b076208158c48692ac467bff23738ac5f801afbee150a439f133b8658d78099f6a4eac5
|
@@ -176,6 +176,10 @@ class LHS::Record
|
|
176
176
|
@record_class.find_by(params, chain_options)
|
177
177
|
end
|
178
178
|
|
179
|
+
def find_by!(params = {})
|
180
|
+
@record_class.find_by!(params, chain_options)
|
181
|
+
end
|
182
|
+
|
179
183
|
# Returns a hash of where conditions
|
180
184
|
def where_values_hash
|
181
185
|
chain_parameters
|
data/lib/lhs/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
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
|
+
stub_request(:get, "http://datastore/records/?limit=1&name=Steve")
|
9
|
+
.to_return(body: [{ name: 'Steve', color: 'blue' }].to_json)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'allows chaining find_by' do
|
13
|
+
Record.options(params: { color: 'blue' }).find_by(name: 'Steve')
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'allows chaining find_by!' do
|
17
|
+
Record.options(params: { color: 'blue' }).find_by!(name: 'Steve')
|
18
|
+
end
|
19
|
+
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: 6.7.
|
4
|
+
version: 6.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-
|
11
|
+
date: 2016-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lhc
|
@@ -301,6 +301,7 @@ files:
|
|
301
301
|
- spec/record/endpoint_options_spec.rb
|
302
302
|
- spec/record/endpoints_spec.rb
|
303
303
|
- spec/record/equality_spec.rb
|
304
|
+
- spec/record/find_by_chains_spec.rb
|
304
305
|
- spec/record/find_by_spec.rb
|
305
306
|
- spec/record/find_each_spec.rb
|
306
307
|
- spec/record/find_in_batches_spec.rb
|
@@ -450,6 +451,7 @@ test_files:
|
|
450
451
|
- spec/record/endpoint_options_spec.rb
|
451
452
|
- spec/record/endpoints_spec.rb
|
452
453
|
- spec/record/equality_spec.rb
|
454
|
+
- spec/record/find_by_chains_spec.rb
|
453
455
|
- spec/record/find_by_spec.rb
|
454
456
|
- spec/record/find_each_spec.rb
|
455
457
|
- spec/record/find_in_batches_spec.rb
|