From 5f2b2c9436950866c869a86f1053255dbb39147e Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 25 Nov 2019 16:47:31 +0000 Subject: [PATCH] code layout clean up app/models/user.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19297 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/user.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index c7612c91b..e291bd98b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -589,7 +589,10 @@ class User < Principal end def roles - @roles ||= Role.joins(members: :project).where(["#{Project.table_name}.status <> ?", Project::STATUS_ARCHIVED]).where(Member.arel_table[:user_id].eq(id)).distinct + @roles ||= + Role.joins(members: :project). + where(["#{Project.table_name}.status <> ?", Project::STATUS_ARCHIVED]). + where(Member.arel_table[:user_id].eq(id)).distinct end # Returns the user's bult-in role -- 2.39.5