Open rus-max opened 1 year ago
Hi!
Is it possible to add context to relations has_one/has_many?
context
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
context
to relationshas_one
/has_many
?