Join GitHub today
Custom options are accessible in serializer #512
I'm using CarrierWave and need to return image urls in my API. I'd like to have 1 serializer that renders an array of image urls. I was thinking of creating a declarative API for it like:
attribute :cover_image, serializer: ImageVersionSerializer, versions: [:thumb, :large]
But I can't specify versions without access to the options.
I have a similar use case where a serializer should render an array of things (time series elements) and i need to pass a time range parameter to the serializer.