Skip to content

Commit a7a5985

Browse files
committed
fix warnings
Ruby 2.7 deprecates automatic conversion from a hash to keyword arguments https://blog.saeloun.com/2019/10/07/ruby-2-7-keyword-arguments-redesign.html fixing those up, plus one more I noticed in the logs from JsonApiClient#370 (comment) https://travis-ci.org/github/JsonApiClient/json_api_client/jobs/722402404 thanks @sharshenov
1 parent c94d6c7 commit a7a5985

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

lib/json_api_client/query/requestor.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@ def initialize(klass)
1010

1111
# expects a record
1212
def create(record)
13-
request(:post, klass.path(record.path_attributes), {
14-
body: { data: record.as_json_api },
15-
params: record.request_params.to_params
16-
})
13+
request(
14+
:post,
15+
klass.path(record.path_attributes),
16+
body: { data: record.as_json_api },
17+
params: record.request_params.to_params
18+
)
1719
end
1820

1921
def update(record)
20-
request(:patch, resource_path(record.path_attributes), {
21-
body: { data: record.as_json_api },
22-
params: record.request_params.to_params
23-
})
22+
request(
23+
:patch,
24+
resource_path(record.path_attributes),
25+
body: { data: record.as_json_api },
26+
params: record.request_params.to_params
27+
)
2428
end
2529

2630
def get(params = {})

test/unit/errors_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def test_connection_errors
1010
User.all
1111
end
1212

13-
assert_match /specific message/, err.message
13+
assert_match(/specific message/, err.message)
1414
end
1515

1616
def test_timeout_errors

0 commit comments

Comments
 (0)