From d940d5eb1d951f522e34e505bc422d3c4cf3b468 Mon Sep 17 00:00:00 2001 From: Nigel <273409891@qq.com> Date: Sat, 21 Sep 2019 21:25:29 +0800 Subject: [PATCH] modify the code to solve the undefined problem in issue.rb --- app/models/issue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index b9a3d9bea..8243f492a 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -645,7 +645,7 @@ class Issue < ActiveRecord::Base user_real = user || User.current roles = user_real.admin ? Role.all : user_real.roles_for_project(project) - return {} if roles.empty? + return {} if roles.length == 0 result = {} workflow_permissions = WorkflowPermission.where(:tracker_id => tracker_id, :old_status_id => status_id, :role_id => roles.map(&:id)).all