Merge r23325 from trunk to 6.0-stable (#41894).

git-svn-id: https://svn.redmine.org/redmine/branches/6.0-stable@23326 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2024-11-29 07:52:56 +00:00
parent fdc9210e21
commit 93d6299960

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