- Have children controllers inherit callbacks from their parent
- Have child records without their own serializers inherit their type names from their parent
- Enforce
Caprese::Record
on all records serialized - Allow editing of meta tag document
- Modify
validates_associated
to propagate nested association errors to the record itself - Fail with
422 Unprocessable Entity
if any callbacks add an error to a record being persisted or updated
- Remove strict dependencies
- Allow scoping of
has_many
relationships in serializers, i.e. when the relationship is included in another primary document
- Depend on all route primary key URL params to be named
:id
, rather thanCaprese.config.resource_primary_key
- Fix bug in processing of collection relationship data (5e21582)
- Fix bug in persisting of collection relationship data on create (1eb4720)
- Ensure that
record_scope
is always provided a symbol as an argument (c61ac0d)
- Only allow resource identifiers in request documents to use
id
for primary key (JSON API adherent) (93c90eb)
- Completes error source pointer determination to include primary data items and relationship primary data items
- Use default value provided in
options
arg of errors.add before retrieving the value from the record (0ed5a3e)
- Use default value provided in
t
ofoptions
arg of errors.add before determining by other means (f3ad88e)
- Fix rendering of nested relationship base errors (17dc96f)
- Fix
persist_collection_relationships
to not includethrough
relationships
- Add relationship not_found errors to record instead of throwing parameter error (f4b7415)
- Propagate translation options on nested error to parent when validates_associated (2178fbd)
- Allow
record_scope
andrelationship_scope
to return[]
- Refactor RecordNotFoundError and AssociationNotFoundError to use separate
parameter
translations
- Fix bug where
queried_record
uses primary key other than:id
- Add
caprese_is_attribute?
attribute aliasing helper
- Remove dependency on
ActiveRecord#assign_attributes
- Allow calling of
assign_attributes
if the recordresponds_to
it
- Only use
Caprese::Record::AssociatedValidator
ifcaprese_style_errors
- Update rendering concern serializer_for to resemble Serializer.serializer_for
- Allow serialized data links to use parent class links
- Set
::Record.caprese_style_errors
to false when rendering errors, because around_action is not finalized
- Rescue
Exception
temporarily, so we can always turn offcaprese_style_errors
- Fix rendering of non-JSON actions
- Fix use of
ActiveRecord::Validations::AssociatedValidator
inCaprese::AssociatedValidator
- Add
Caprese::Controller#resource_type_aliases
method that returns object mapping type aliases to actual types for the application - Add
Caprese::Record.caprese_field_aliases
method that returns object mapping field aliases to actual fields for the record - Add
Caprese::Record.caprese_type
method that returns singular symbol indicating the type to use when serializing the record. (Caprese::Serializer.json_api_key
now uses this.)
- Change
::Record.caprese_style_errors
to false by default so non-Caprese errors render normally
- Add query_params fields and include to relationship endpoints
- Require AMS 0.10.5
- Actually require AMS 0.10.5 (lol)
- Add
Caprese.config.isolated_namespace
to enable Caprese to work with isolate_namespace Engines by trimming theisolated_namespace
off the front of the result of calls toversion_module
,version_path
,version_name
, etc.
- Add
namespaced_module
andunnamespace
helper to Versioning that provides full module namespace whenconfig.isolate_namespace
is present (replaces the old functionality ofversion_module
andunversion
)
- Record the field aliases that are used in the request so responses will use the same aliases
- Allow options like
serializer
to be passed intoSerializer
association definitions - Allow specification of
relationship_serializer(name)
for serializingget_relationship_data
, similar torelationship_scope
- Fix bug that crashes when
[relationship]/data
is missing - Fix bug in
#update_relationship_definition
- Fix bug in JSON API adapter that inappropriately aliases relationships
- Modifies behavior of
config.optimize_relationships
- Original behavior: Only sends
links
of relationships (nodata
) except those that are inincludes
- New behavior: Relationship is omitted from response entirely except those that are in
includes
- Original behavior: Only sends
- Breaking: Modifies behavior of serializer relationships
- Original behavior: Use the serializer corresponding to the class of objects for the relationships
- Example:
has_many :productos => ProductSerializer
- Example:
- New behavior: Relationships in serializers use the name of the relationship as an assumption about the serializer for that relationship
- Example:
has_many :productos => ProductoSerializer
- Example:
- Can override by passing any serializer:
has_many :productos, serializer: ProductSerializer
- Original behavior: Use the serializer corresponding to the class of objects for the relationships
- Allows
:self
link to be overridden in serializers that subclass Caprese::Serializer
- Add
relationship_scope(relationship_name, scope) => scope
method for all relationships in serializers, allowing override for custom scoping - Refactor
assign_record_attributes
toassign_changes_from_document
, which splits into multiple modular methods that handle relationship data errors with more source pointer detail- Adds
ResourceDocumentInvalidError
for errors pertaining to the document instead of record assignment (RecordInvalidError
) - Allows
PATCH
requests to primary endpoints that update autosaving collection relationships to propagate the nested errors on attributes/relationships up to the primary data so error source pointers are just as detailed as they would be underPOST
requests already - Fields are now assigned in a specific order: attributes, singular relationships, collection relationships
- Adds
- Fix issue regarding
:base
field titles interpolated into error messages - Add more detailed error responses to
update_relationship_definition
endpoints
- Switches to Rails 5, drops support for Rails 4
- Protects against arrays being sent as data for create and update actions