I'm using the master
Active Model Serializer and the Pagination Serializer. This is may Pagination Serializer
# pagination collection serializer
class PaginationSerializer < ActiveModel::Serializer::CollectionSerializer
def initialize(object, options = {})
meta_key = options[:meta_key] || :meta
options[meta_key] ||= {}
options[meta_key][:pagination] = {
current_page: object.current_page,
next_page: object.next_page,
prev_page: object.prev_page,
total_pages: object.total_pages,
total_count: object.total_count,
size: object.total_count
}
super(object, options)
end
end
This is my rendering code.
render json: formulas, serializer: PaginationSerializer, each_serializer: FormulaSimpleSerializer
There no meta key on the result. This happens after upgrading from 0.10.0.RC3 to master. Any idea?