210
211
212
213
214
215
216
217
218
219
220
221
222
|
# File 'lib/rest_framework/controller_mixins/models.rb', line 210
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
|