The purpose of `ActiveModel::Serializers` is to provide an object to encapsulate serialization of `ActiveModel` objects, including `ActiveRecord` objects.
Purpose
The purpose of ActiveModel::Serializers
is to provide an object to
encapsulate serialization of ActiveModel
objects, including ActiveRecord
objects.
Serializers know about both a model and the current_user
, so you can
customize serialization based upon whether a user is authorized to see the
content.
In short, serializers replaces hash-driven development with object-oriented development.