228
229
230
231
232
233
234
235
236
237
238
239
240
|
# File 'lib/rest_framework/controller_mixins/models.rb', line 228
def index!
@records ||= self.get_filtered_data(self.get_recordset)
if self.class.paginator_class
paginator = self.class.paginator_class.new(data: @records, controller: self)
page = paginator.get_page
serialized_page = self.get_serializer_class.new(page, controller: self).serialize
return paginator.get_paginated_response(serialized_page)
else
return self.get_serializer_class.new(@records, controller: self).serialize
end
end
|