active_model_serializers
active_model_serializers copied to clipboard
ActiveModel::Serializer implementation and Rails hooks
`ActiveModelSerializers.config.adapter = :json` instead of using a serializer, for error_messages we do something like this def render_error(resource, status = :unprocessable_entity) render json: { errors: resource.errors.full_messages } , status: status end...
Hi folks, I was trying to upgrade my current project to Rails 5, API-only mode while continuing to use AMS 0.9 (due to pending #1845 being blocker for us) and...
The [README](https://github.com/rails-api/active_model_serializers#semantic-versioning) mentions that this gem adheres to semantic versioning, but the [CHANGELOG](https://github.com/rails-api/active_model_serializers/blob/master/CHANGELOG.md#v0105-2017-03-07) says otherwise. I have a decent test coverage in a codebase using active_model_serializers, but even a patch...
#### Purpose The current behaviour is to always use the same adapter, this is not very desirable in more formal hypermedia conforming systems where content-negotiation determines the format which should...
#### Purpose In my project I have some cases when I need to make a `POST` request with nested data. The following data may be provided: ``` { "data": {...
Just a reminder that we have to write a clear note on how to upgrade from 0.8/0.9, with new features, changed behaviors, and removed features. ref: #1005, #1683
class MySerializer ActiveModel::Serializer attribute :name has_one :parent, :serializer => MySerializer end #### Expected behavior vs actual behavior I expect that when I serialize an object without a parent that I...
#### Expected behavior vs actual behavior ``` class Simpeg::JabatanSerializer < ActiveModel::Serializer type :data end ``` I specify the root key with 'data'. But that not work when collection is empty....
#### Purpose Fixes small typos and updated the docs on relationship links for JSONAPI. #### Changes Removed the 'data' key in the serialized relationship. Including it according to the current...