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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 325e7b214a89c1e31cee0be6ed5958cd9e134430
4
- data.tar.gz: cd8d528f00f08d40b445e49856f0f617287dd8b6
3
+ metadata.gz: fbd933665cec45ce1436c7269a629daff5434bed
4
+ data.tar.gz: 442dcbe99d90e1c91b6b807edb8e8a0124da990a
5
5
  SHA512:
6
- metadata.gz: 0c11af41a6074ef3cf601a6dd0b5136bf558befae1b9d0a6ca8db7e25c23351dbaa746683162de20206c3f00c3b3af40ebdc5344d2d700a2c96c4681452e572b
7
- data.tar.gz: 3fc266b541674def93c38e535f924c1185fe34d9a4c6f91b581f49ffb8788c09c112ea6cb0d4aac47aa34a9fd4db79734991234f331e66feebc0b723a27d3201
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
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = "6.7.0"
2
+ VERSION = "6.7.1"
3
3
  end
@@ -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.0
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-09-30 00:00:00.000000000 Z
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