From: Toshi MARUYAMA Date: Mon, 25 Nov 2019 16:47:31 +0000 (+0000) Subject: code layout clean up app/models/user.rb X-Git-Tag: 4.2.0~1343 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5f2b2c9436950866c869a86f1053255dbb39147e;p=redmine.git code layout clean up app/models/user.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19297 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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