From d208cb64214929d619f8b44aa571e0b2237eda14 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 26 Sep 2020 15:02:02 +0000 Subject: [PATCH] fix source indent of app/models/issue.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20083 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index a1066c4c2..8c3146137 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1191,10 +1191,10 @@ class Issue < ActiveRecord::Base # Returns a scope of the given issues and their descendants def self.self_and_descendants(issues) Issue.joins( - "JOIN #{Issue.table_name} ancestors" + - " ON ancestors.root_id = #{Issue.table_name}.root_id" + - " AND ancestors.lft <= #{Issue.table_name}.lft AND ancestors.rgt >= #{Issue.table_name}.rgt" - ). + "JOIN #{Issue.table_name} ancestors" + + " ON ancestors.root_id = #{Issue.table_name}.root_id" + + " AND ancestors.lft <= #{Issue.table_name}.lft AND ancestors.rgt >= #{Issue.table_name}.rgt" + ). where(:ancestors => {:id => issues.map(&:id)}) end @@ -1417,10 +1417,11 @@ class Issue < ActiveRecord::Base def self.update_versions_from_hierarchy_change(project) moved_project_ids = project.self_and_descendants.reload.pluck(:id) # Update issues of the moved projects and issues assigned to a version of a moved project - Issue.update_versions( - ["#{Version.table_name}.project_id IN (?) OR #{Issue.table_name}.project_id IN (?)", - moved_project_ids, moved_project_ids] - ) + Issue. + update_versions( + ["#{Version.table_name}.project_id IN (?) OR #{Issue.table_name}.project_id IN (?)", + moved_project_ids, moved_project_ids] + ) end def parent_issue_id=(arg) -- 2.39.5