Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions lib/json_api_client/query/requestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ def initialize(klass)

# expects a record
def create(record)
request(:post, klass.path(record.path_attributes), {
body: { data: record.as_json_api },
params: record.request_params.to_params
})
request(
:post,
klass.path(record.path_attributes),
body: { data: record.as_json_api },
params: record.request_params.to_params
)
end

def update(record)
request(:patch, resource_path(record.path_attributes), {
body: { data: record.as_json_api },
params: record.request_params.to_params
})
request(
:patch,
resource_path(record.path_attributes),
body: { data: record.as_json_api },
params: record.request_params.to_params
)
end

def get(params = {})
Expand Down
2 changes: 1 addition & 1 deletion test/unit/errors_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_connection_errors
User.all
end

assert_match /specific message/, err.message
assert_match(/specific message/, err.message)
end

def test_timeout_errors
Expand Down