sift icon indicating copy to clipboard operation
sift copied to clipboard

Sort Not Respecting Param Order

Open melch opened this issue 8 years ago • 0 comments

The sorts are not respecting the order passed by the client when chaining multiple sorts. It appears that sort order is determined by the order in which sort_on is declared in the filterable class.

For example, passing the following sort params both result in the same query: sort=title,submittal_package sort=submittal_package,title

ORDER BY LOWER(submittal_logs.title) ASC NULLS FIRST,
  natural_sort(packages_for_sort.number) COLLATE en_US ASC,
  natural_sort(packages_for_sort.title) COLLATE en_US ASC NULLS FIRST

melch avatar Nov 28 '17 23:11 melch