]> source.dussan.org Git - redmine.git/commitdiff
code layout clean up app/models/user.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 25 Nov 2019 16:47:31 +0000 (16:47 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 25 Nov 2019 16:47:31 +0000 (16:47 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19297 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/user.rb

index c7612c91b884e9c8351797e8d57e83fd5e69f6c2..e291bd98b82232242becc245f647458d9744cec7 100644 (file)
@@ -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