Hi!
Is it possible to add context to relations has_one/has_many?
class PostSerializer < Panko::Serializer
attributes :context_attribute
def context_attribute
context[:date] || object.date
end
end
class UserSerializer < Panko::Serializer
attributes :name, :address
has_many :posts, serializer: PostSerializer, context: { date: object.date }
end
Hi!
Is it possible to add
contextto relationshas_one/has_many?