From c3959f903abd15cfc51132fb546851bf383d46d8 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Fri, 17 Jan 2020 23:12:34 +0100 Subject: [PATCH] FIX: Convert ID into integer before sorting --- app/controllers/discourse_assign/assign_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/discourse_assign/assign_controller.rb b/app/controllers/discourse_assign/assign_controller.rb index d40fd39..07a0480 100644 --- a/app/controllers/discourse_assign/assign_controller.rb +++ b/app/controllers/discourse_assign/assign_controller.rb @@ -90,7 +90,7 @@ module DiscourseAssign .includes(:tags) .includes(:user) .joins("JOIN topic_custom_fields tcf ON topics.id = tcf.topic_id AND tcf.name = 'assigned_to_id' AND tcf.value IS NOT NULL") - .order('tcf.value, topics.bumped_at desc') + .order('tcf.value::integer, topics.bumped_at desc') .offset(offset) .limit(limit)