From 14234eae3948fefddce58cda76c94841f836fb08 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 9 Apr 2016 07:42:52 +0000 Subject: Don't reject users that already watch one of the objects (#5754). git-svn-id: http://svn.redmine.org/redmine/trunk@15313 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/watchers_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index 37c03cdaa..488898546 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -121,8 +121,8 @@ class WatchersController < ApplicationController scope = User.all.limit(100) end users = scope.active.visible.sorted.like(params[:q]).to_a - if @watchables - users -= @watchables.map(&:watcher_users).flatten + if @watchables && @watchables.size == 1 + users -= @watchables.first.watcher_users end users end -- cgit v1.2.3