From: Toshi MARUYAMA Date: Sat, 11 Jul 2020 16:21:21 +0000 (+0000) Subject: fix source indent of Issue#self_and_descendants X-Git-Tag: 4.2.0~912 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9568e81d73f5bcc99007222ff5cd7e0e59626a60;p=redmine.git fix source indent of Issue#self_and_descendants git-svn-id: http://svn.redmine.org/redmine/trunk@19885 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/issue.rb b/app/models/issue.rb index 0c691f355..05a497c00 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1187,7 +1187,8 @@ 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" + + 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" ).