diff --git a/app/datatables/custom_datatable.rb b/app/datatables/custom_datatable.rb index 0b60d9e12..033bb49b8 100644 --- a/app/datatables/custom_datatable.rb +++ b/app/datatables/custom_datatable.rb @@ -18,8 +18,8 @@ class CustomDatatable < AjaxDatatablesRails::Base def fetch_records records = get_raw_records - records = sort_records(records) if order_params.present? records = filter_records(records) if dt_params[:search].present? + records = sort_records(records) if order_params.present? records = paginate_records(records) unless dt_params[:length].present? && dt_params[:length] == '-1' records