Skip to content

Releases: cerebris/jsonapi-resources

v0.5.2 - Abstract resources

28 Jul 21:43
Compare
Choose a tag to compare

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

27 Jul 21:07
Compare
Choose a tag to compare

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

16 Jul 21:18
Compare
Choose a tag to compare

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 of send to prevent inadvertent access level violations.
  • Errors now use the source instead of path 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 option foreign_key_on can now be set to related 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

06 Jul 16:01
Compare
Choose a tag to compare

Adds the configuration option exception_class_whitelist.

v0.4.3 - Polymorphic associations, context bases relations, and some bug fixes

05 Jul 16:22
Compare
Choose a tag to compare

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

19 Jun 12:46
Compare
Choose a tag to compare

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

18 Jun 17:18
Compare
Choose a tag to compare

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

10 Jun 15:53
Compare
Choose a tag to compare

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 of updatable
  • createable Resource method has been deprecated in favor of creatable

v0.3.3

26 Apr 17:31
Compare
Choose a tag to compare

Fixes issue with formatted type for has many associations.

v0.3.2

24 Apr 15:34
Compare
Choose a tag to compare

Fixes issues with formatting type types, ids and routes.
Fixes #171