]> source.dussan.org Git - redmine.git/commitdiff
avoid using rescue in its modifier form at WatchersController#find_objects_from_params
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 8 Jul 2020 17:30:19 +0000 (17:30 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 8 Jul 2020 17:30:19 +0000 (17:30 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19865 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/watchers_controller.rb

index 249d10d35fef8a9f903ad3990515e368cd286b73..ffd1e79bbbd74e45e02500872570648abe1e4522 100644 (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]))