Skip to content

Pass contexts to serializers #21

Description

@Nitemaeric

I want to be able to add custom context to my serializers.

A common use case is passing authentication statuses to serializers.

class Api::V1::PostSerializer < Transmutation::Serializer
  attribute :view_count, if: -> { current_user.admin? }
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions