Fix random test failure by ensuring @WatchersController#find_objects_from_params@ returns results in consistent order (#41894).

Patch by Go MAEDA (user:maeda).

git-svn-id: https://svn.redmine.org/redmine/trunk@23325 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2024-11-29 07:52:05 +00:00
parent e61e405646
commit d63678068a

View File

@@ -217,7 +217,7 @@ class WatchersController < ApplicationController
return unless klass < ApplicationRecord
return unless klass < Redmine::Acts::Watchable::InstanceMethods
scope = klass.where(:id => Array.wrap(params[:object_id]))
scope = klass.where(:id => Array.wrap(params[:object_id])).order(:id)
if klass.reflect_on_association(:project)
scope = scope.preload(:project => :enabled_modules)
end