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_relationmethods - Uses
public_sendinstead ofsendto prevent inadvertent access level violations. - Errors now use the
sourceinstead ofpathparameter, 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_toassociation on the model have been fixed. A new optionforeign_key_oncan now be set torelatedto 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_linkreplace_has_many_links=>replace_to_many_linkscreate_has_one_link=>create_to_one_linkreplace_has_one_link=>replace_to_one_linkreplace_polymorphic_has_one_link=>replace_polymorphic_to_one_linkremove_has_many_link=>remove_to_many_linkremove_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