From 0d8ed7925ffdf58b912df0b73dffe227dfa2752c Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Thu, 9 Jan 2020 10:03:41 +0800 Subject: [PATCH] FIX code review --- app/controllers/watchers_controller.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index d9a8e898c..dceebee72 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -1,6 +1,6 @@ class WatchersController < ApplicationController before_action :require_login, except: %i[index] - before_action :set_project + before_action :find_project_with_id def index scope = @project.watchers.includes(:user) @@ -31,11 +31,4 @@ class WatchersController < ApplicationController end end - private - def set_project - @project = Project.find params[:project_id] - rescue Exception => e - tip_exception(e.message) - end - end