From cd70187c2fa2a5058690fde78dcdcb1c759c204e Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 20 Sep 2022 03:16:05 +0000 Subject: Introduces a UserQuery model for admin/users (#37674). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Jens Krämer. git-svn-id: https://svn.redmine.org/redmine/trunk@21823 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/query.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/query.rb') diff --git a/app/models/query.rb b/app/models/query.rb index 1a614f175..196568379 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -150,7 +150,8 @@ class QueryCustomFieldColumn < QueryColumn end def value_object(object) - if custom_field.visible_by?(object.project, User.current) + project = object.project if object.respond_to?(:project) + if custom_field.visible_by?(project, User.current) cv = object.custom_values.select {|v| v.custom_field_id == @cf.id} cv.size > 1 ? cv.sort_by {|e| e.value.to_s} : cv.first else -- cgit v1.2.3