v1.0.0
Changes
Performance
Dynamic attribute definitions improvement (PR JsonApiClient/json_api_client#281)
Before:
user system total real
read: 1.090000 0.010000 1.100000 ( 1.091464)
write: 1.130000 0.000000 1.130000 ( 1.136750)
After:
user system total real
read: 0.020000 0.000000 0.020000 ( 0.016366)
write: 0.690000 0.000000 0.690000 ( 0.687914)
Features
- Return a QueryBuilder from HasMany associations instead of an Array (PR JsonApiClient/json_api_client#274 and Issue JsonApiClient/json_api_client#270)
- Support for custom header inheritance (PR JsonApiClient/json_api_client#280)
- Add Authorization helpers to base Resource:
JSONAPI::Consumer::Resource.authorize_with=
setsAuthorization=Bearer #{val}
headerJSONAPI::Consumer::Resource.authorize_with(jwt, &block)
same as above, but for only a single request.JSONAPI::Consumer::Resource.authorized?
returns true/false if Authorization is not emptyJSONAPI::Consumer::Resource.clear_authorization!
clears the Authorization headerJSONAPI::Consumer::Resource.authorized_as
returns the Authorization header
Bugfixes
- Fetch a HasOne relationship that was not included in the original query (JsonApiClient/json_api_client#244)