summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-09-20 03:16:05 +0000
committerGo MAEDA <maeda@farend.jp>2022-09-20 03:16:05 +0000
commitcd70187c2fa2a5058690fde78dcdcb1c759c204e (patch)
tree0c863e7455fd70c855522692c0480b843c4be6c7 /app/models/query.rb
parent42b381985bebdb025bfba8466840b76d1c917d12 (diff)
downloadredmine-cd70187c2fa2a5058690fde78dcdcb1c759c204e.tar.gz
redmine-cd70187c2fa2a5058690fde78dcdcb1c759c204e.zip
Introduces a UserQuery model for admin/users (#37674).
Patch by Jens Krämer. git-svn-id: https://svn.redmine.org/redmine/trunk@21823 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r--app/models/query.rb3
1 files changed, 2 insertions, 1 deletions
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