Releases: RestPack/restpack_serializer
Releases · RestPack/restpack_serializer
Support Rails 5
Adds support for Rails 5. 🍻 @wiracocha
v0.5.8
Changes:
Optional attributes: #117
class PersonSerializer
include RestPack::Serializer
attributes :id, :name
optional :description
endBy default, description won't be serialized. To force inclusion:
PersonSerializer.as_json(album, { include_description?: true })Hash models: #118
Previously RestPack::Serializer only supported objects as models. If your models are a Hash, there is not longer any need for serializer methods such as:
def name
@model[:name]
end