From 73d8fa1d3fb3aaf561733efc4c4eeb1adb8d9d72 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:33:42 +0100 Subject: [PATCH] Also sort by id --- app/controllers/organisations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index 9506cf745..fd3350442 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -18,7 +18,7 @@ class OrganisationsController < ApplicationController @pagy, @organisations = pagy(filtered_collection(all_organisations.visible, search_term)) @merge_requests = MergeRequest.visible .joins("LEFT JOIN organisations ON organisations.id = merge_requests.absorbing_organisation_id") - .order(Arel.sql("organisations.name, merge_requests.merge_date IS NULL, merge_requests.merge_date DESC")) + .order(Arel.sql("organisations.name, merge_requests.merge_date IS NULL, merge_requests.merge_date DESC, merge_requests.id")) @searched = search_term.presence @total_count = all_organisations.visible.size end