1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-27 02:41:15 +00:00

avoid using rescue in its modifier form at WatchersController#find_objects_from_params

git-svn-id: http://svn.redmine.org/redmine/trunk@19865 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2020-07-08 17:30:19 +00:00
parent ddcdac3017
commit 445f6528e2

View File

@ -134,7 +134,12 @@ class WatchersController < ApplicationController
end
def find_objects_from_params
klass = Object.const_get(params[:object_type].camelcase) rescue nil
klass =
begin
Object.const_get(params[:object_type].camelcase)
rescue
nil
end
return unless klass && klass.respond_to?('watched_by')
scope = klass.where(:id => Array.wrap(params[:object_id]))