summaryrefslogtreecommitdiffstats
path: root/app/controllers/watchers_controller.rb
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-10-05 19:34:35 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-10-05 19:34:35 +0000
commit70339d2453fe4c297da982a6693c4c2889e2c294 (patch)
treefd60024dd455c373d42bc99a7182b60689e8709d /app/controllers/watchers_controller.rb
parent556f32f27461d568afd0aa0e03edea25187923d6 (diff)
downloadredmine-70339d2453fe4c297da982a6693c4c2889e2c294.tar.gz
redmine-70339d2453fe4c297da982a6693c4c2889e2c294.zip
Merged r21235 from trunk to 4.1-stable (#35463).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@21237 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/watchers_controller.rb')
-rw-r--r--app/controllers/watchers_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb
index f0692e31d..023f7e403 100644
--- a/app/controllers/watchers_controller.rb
+++ b/app/controllers/watchers_controller.rb
@@ -134,7 +134,9 @@ class WatchersController < ApplicationController
def find_objets_from_params
klass = Object.const_get(params[:object_type].camelcase) rescue nil
- return unless klass && klass.respond_to?('watched_by')
+ return unless klass && Class === klass # rubocop:disable Style/CaseEquality
+ return unless klass < ActiveRecord::Base
+ return unless klass < Redmine::Acts::Watchable::InstanceMethods
scope = klass.where(:id => Array.wrap(params[:object_id]))
if klass.reflect_on_association(:project)