Incidentally reverted fix.

This commit is contained in:
pavel-jurasek-hypofriend-de 2021-02-23 14:52:30 +01:00
parent 36ce6a956f
commit e0cd6558b5
1 changed files with 2 additions and 2 deletions

View File

@ -44,9 +44,9 @@ module Ransack
else
case Ransack.options[:postgres_fields_sort_option]
when :nulls_first
scope_or_sort = scope_or_sort.direction == :asc ? ("#{scope_or_sort.to_sql} NULLS FIRST") : ("#{scope_or_sort.to_sql} NULLS LAST")
scope_or_sort = scope_or_sort.direction == :asc ? Arel.sql("#{scope_or_sort.to_sql} NULLS FIRST") : Arel.sql("#{scope_or_sort.to_sql} NULLS LAST")
when :nulls_last
scope_or_sort = scope_or_sort.direction == :asc ? ("#{scope_or_sort.to_sql} NULLS LAST") : ("#{scope_or_sort.to_sql} NULLS FIRST")
scope_or_sort = scope_or_sort.direction == :asc ? Arel.sql("#{scope_or_sort.to_sql} NULLS LAST") : Arel.sql("#{scope_or_sort.to_sql} NULLS FIRST")
end
relation = relation.order(scope_or_sort)