NAME

WebAPI::DBIC::Resource::ActiveModel

VERSION

version 0.004002

NAME

WebAPI::DBIC::Resource::ActiveModel - ActiveModel support for WebAPI::DBIC

Media Type

These roles respond to the application/json media type. (This is a very common 'default' media type for web data services.)

ActiveModel

Designed to match the behaviour of the active_model_serializers Ruby gem and thus be directly usable as a backend for frameworks compatible with it, including Ember.

See http://emberjs.com/api/data/classes/DS.ActiveModelAdapter.html for more information.

Roles

The WebAPI::DBIC::Resource::ActiveModel::Role::DBIC role provides core methods required to support the other roles listed below.

The WebAPI::DBIC::Resource::ActiveModel::Role::Set and WebAPI::DBIC::Resource::ActiveModel::Role::Item roles handle GET and HEAD requests for set (resultset) and item (row) resources.

The WebAPI::DBIC::Resource::ActiveModel::Role::SetWritable role handles POST requests to set (resultset) resources. It handles the recursive creation of related records. Related records can be nested to any depth and are created from the bottom up within a transaction.

The WebAPI::DBIC::Resource::ActiveModel::Role::ItemWritable roles handle PUT and DELETE requests for item (row) resources. It handles the recursive update of related records. Related records can be nested to any depth and are updated from the bottom up within a transaction. Handles both 'PUT is replace' and 'PUT is update' logic.

There's no ActiveModel specific handling for invoking methods on resources yet. You can use the generic WebAPI::DBIC::Resource::Role::ItemInvoke or WebAPI::DBIC::Resource::Role::SetInvoke role.

AUTHOR

Tim Bunce <Tim.Bunce@pobox.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Tim Bunce.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.