def parse_sorting_param(sorting_param, model)
      return {} unless sorting_param.present?

      sorting_params = CSV.parse_line(URI.unescape(sorting_param)).collect do |sort|
        sorting_param = if sort.start_with?('-')
                          { field: sort[1..-1].to_s.to_sym, direction: :desc }
                        else
                          { field: sort.to_s.to_sym, direction: :asc }
                        end

        check_sorting_param(model, sorting_param)
        sorting_param
      end
      sorting_params.map { |par| [par[:field], par[:direction]] }.to_h
    end
def parse_sorting_param(sorting_param, model)
      return {} unless sorting_param.present?

      sorting_params = CSV.parse_line(URI.unescape(sorting_param)).collect do |sort|
        sorting_param = if sort.start_with?('-')
                          { field: sort[1..-1].to_s.to_sym, direction: :desc }
                        else
                          { field: sort.to_s.to_sym, direction: :asc }
                        end

        check_sorting_param(model, sorting_param)
        sorting_param
      end
      sorting_params.map { |par| [par[:field], par[:direction]] }.to_h
    end
------------------------ Sort helpers --------------------
 model -> resource_class with inherited resources