Skip to content

Releases: RestPack/restpack_serializer

Support Rails 5

24 Nov 09:06
Compare
Choose a tag to compare

Adds support for Rails 5. 🍻 @wiracocha

v0.5.8

04 Feb 21:42
Compare
Choose a tag to compare

Changes:

Optional attributes: #117

class PersonSerializer
    include RestPack::Serializer

    attributes :id, :name
    optional :description
end

By 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