Netflix / fast_jsonapi

No Longer Maintained - A lightning fast JSON:API serializer for Ruby Objects.
Apache License 2.0
5.07k stars 425 forks source link

Single attribute with serializer parameter #479

Open Mikkko opened 2 years ago

Mikkko commented 2 years ago

Is it possible to pass serializer name as parameter with a single attribute? attribute :attribute_name, serializer: SerializerName

instead of:

attribute :attribute_name do |object|
  SerializerName.new(object.attribute_name)
end

We can do it with relationships, when we call has_many or another type, but I cannot find it for single attribute