Is there a way I can add a non-model metadata attribute onto an each_serializer
, without using the :json_api
adapter?
render json: invoices, each_serializer: Invoices::ItemizedSerializer
I want it to be...
{
data: [{..invoice 1...}, {...invoice 2...}]
metadata: {total: 500}
}
instead of
[
{..invoice 1...},
{...invoice 2...}
]