I want to take the results of a pl/pgsql function, that returns a set of records and user AMS to serialize the results. How can I do this?
AMS can serialize a Plain-Old Ruby Object. AMS provides ActiveModelSerializers::Model
which can easily make a PORO a serializable object by doing this:
class MyModel < ActiveModelSerializers::Model
attributes :id, :name, :level
end
MyModelSerializer would be the default serializer.