app/services/report_request_list.rb
def request_order(sort_order)
        return { "updated_at" => "desc" } unless sort_order
        sort_field, _, sort_direction = sort_order.rpartition("_")
        { sort_field => sort_direction }
      end
# sort_field can be any field, we use dates to start out with
# sort_direction can be "asc" or "desc"
# default is updated date, descending
sort_field can be any field, we use dates to start out with
sort_direction can be "asc" or "desc"
default is updated date, descending
sort_field can be any field we use dates to start out with sort_direction can be " asc " or " desc " default is updated date descending
def request_order(sort_order)
        return { "updated_at" => "desc" } unless sort_order
        sort_field, _, sort_direction = sort_order.rpartition("_")
        { sort_field => sort_direction }
      end
def request_order ( sort_order ) return { "updated_at" => "desc" } unless sort_order sort_field , _ , sort_direction = sort_order . rpartition ( "_" ) { sort_field => sort_direction } end
sort_field can be any field, we use dates to start out with
sort_direction can be "asc" or "desc"
default is updated date, descending
sort_field can be any field we use dates to start out with sort_direction can be " asc " or " desc " default is updated date descending
sort_order