Skip to content

Releases: yosiat/panko_serializer

v0.1.10

14 Oct 14:33
Compare
Choose a tag to compare
  • Performance: on method fields, skip settings the context if there is no context (62954e4)
  • Bug Fix: Serializing null fields in string fields as empty string (d171997)

v0.1.9

11 Oct 16:25
Compare
Choose a tag to compare
  • Improving performance of filters (#11)

v0.1.8

29 Sep 09:47
Compare
Choose a tag to compare

Important

Fixing require for panko, Instead of requiring "panko" explicitly, now Panko will be automatically required correctly in bundler environment.

v0.1.7

29 Sep 09:22
Compare
Choose a tag to compare

New Feature

Aliases #10

If we have attribute name which we want to expose to the client as another name, the simple way to do it is create new method attribute, for example:

class PostSerializer < Panko::Serializer
  attribute :published_at

  def published_at
    object.created_at
  end
end

The downside of this approach is that we get a direct hit on performance - we skip Panko Type Casting performance optimizations (Type Casting - Explanation).

With aliases, we can give created_at a new name, by creating an alias to it.

class PostSerializer < Panko::Serializer
  aliases created_at: :published_at
end

Changes

  • Cleaning benchmarks running code
  • Adding support to additional_types