diff options
Diffstat (limited to 'app/controllers/watchers_controller.rb')
-rw-r--r-- | app/controllers/watchers_controller.rb | 4 |
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) |