Releases: cerebris/jsonapi-resources
v0.5.2 - Abstract resources
This release adds the abstract
option to resources. Used to indicate a resource that's intended to be used as the base class for other resources and is not backed by a model. This change was needed to fix an issue using base classes that arose from changes in v0.5.1.
Also fixes an issue handling empty sort parameters.
v0.5.1 - Minor features and some bug fixes
New features:
exception_class_whitelist
configuration option now applies to descendant exceptions- Params other than
id
no longer raise and exception when deleting a resource - When a resource is backed from an ArctiveRecord model the class name is read from the model by default
Bug fixes:
- Primary key (other than
id
) behavior has now been fixed. - Error attributes and relationships are now using the formatter.
- Transactions are now used no matter how many operations are being processed
- All operations were being treated as transactional.
v0.5.0 - Associations Reworked to Relationships
Note: this release contains some breaking changes from earlier versions.
This release fixes the following issues:
- Context is now correctly passed into the
records_for_relation
methods - Uses
public_send
instead ofsend
to prevent inadvertent access level violations. - Errors now use the
source
instead ofpath
parameter, as per the JSON API spec. - Resource linkage is no longer output by default.
- Fixed issue with "to one" relationships that are backed by a
belongs_to
association on the model have been fixed. A new optionforeign_key_on
can now be set torelated
to indicate the location of the foreign key. This defaults to:self
.
Change list:
- Resource interrogates the model for the primary key in most instances. Readme has been corrected regarding using alternate primary keys.
- Now supports engines. Generates the correct urls when run as an engine.
- New configuration and relationship option to include resource linkage.
- Internally Associations have been renamed to Relationships.
- New
relationship
- Has One has been renamed to To One.
- Has many has been renamed to To Many.
The following resource
callbacks have been renamed:
create_has_many_link
=>create_to_many_link
replace_has_many_links
=>replace_to_many_links
create_has_one_link
=>create_to_one_link
replace_has_one_link
=>replace_to_one_link
replace_polymorphic_has_one_link
=>replace_polymorphic_to_one_link
remove_has_many_link
=>remove_to_many_link
remove_has_one_link
=>remove_to_one_link
Resource methods that reference associations
have been renamed to reference relationships
. Methods the reference "has one" have been renamed to "to one". Methods the reference "has many" have been renamed to "to many". The following resource
methods are designed to be overridden. The following name changes have been made:
verify_association_filter
=>verify_relationship_filter
_updatable_associations
=>_updatable_relationships
v0.4.4 - exception class whitelist
Adds the configuration option exception_class_whitelist
.
v0.4.3 - Polymorphic associations, context bases relations, and some bug fixes
New features include:
- Polymorphic associations.
- Associations can select the relation on the model based on the context.
- Updates to the Readme.
Bug fixes include:
- Routing methods now support both arrays and single values.
- Accessing the record_count sometimes resulted in an error.
- Multiword resource types were not generating the correct class.
- Related record ids where not being retrieved using the same query as the related resources themselves. This resulted in possible mismatches and broke the eager loading which led to running many more queries than required if includes were specified in the request.
And finally there was some significant code cleanup involving formatting an removing some unused variables.
v0.4.2 - Bug fix context in FindOperation
Reworks the way context is passed into operations. This fixes a bug where context wasn't available in the record_count method of the FindOperation.
Also adds the ability to pass options into the attributes
call on a resource.
v0.4.1 - Top level links and record count
Adds custom top level links from operations and the operations processor.
Adds optional top level links from paginators on find operations.
Adds optional record count in top level meta.
Adds routing options to jsonapi_relationships.
Removes unused edit and new routes.
v0.4.0 - JSONAPI 1.0
This is a fairly substantial set of changes made to comply with JSONAPI 1.0. Expect that using this release will significantly change the behavior of your app.
Major Changes
- JSON Serializer Output has been updated
- Payload format for CRUD has been updated to JSONAPI 1.0 format. The older request format will now produce errors.
- Includes now include intermediate resources, per the spec
- ValueFormatters no longer accept a
context
parameter - Fixed the order of events related to saving a resource
- Fix paged based pagination issue page limits
- Fixed issue with N+1 queries being run for included resources
- Controller logic moved to
ActsAsResourceController
module (does not break backwards compatibility) - Fixed issue with primary key names
- All controller actions converted to
Operations
- Top level meta information procedure created
updateable
Resource method has been deprecated in favor ofupdatable
createable
Resource method has been deprecated in favor ofcreatable