From cb2d4068e8294d9ca31578b2f07b130751b98471 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 19 Oct 2019 13:32:59 +0000 Subject: code cleanup: rubocop: fix Lint/IneffectiveAccessModifier in lib/redmine/helpers/gantt.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18776 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/helpers/gantt.rb | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'lib/redmine') diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index 2258faf9c..db0676ba7 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -667,23 +667,26 @@ module Redmine start_date + (end_date - start_date + 1) * (progress / 100.0) end - def self.sort_issues!(issues) - issues.sort_by! {|issue| sort_issue_logic(issue)} - end + # Singleton class method is public + class << self + def sort_issues!(issues) + issues.sort_by! {|issue| sort_issue_logic(issue)} + end - def self.sort_issue_logic(issue) - julian_date = Date.new() - ancesters_start_date = [] - current_issue = issue - begin - ancesters_start_date.unshift([current_issue.start_date || julian_date, current_issue.id]) - current_issue = current_issue.parent - end while (current_issue) - ancesters_start_date - end + def sort_issue_logic(issue) + julian_date = Date.new() + ancesters_start_date = [] + current_issue = issue + begin + ancesters_start_date.unshift([current_issue.start_date || julian_date, current_issue.id]) + current_issue = current_issue.parent + end while (current_issue) + ancesters_start_date + end - def self.sort_versions!(versions) - versions.sort! + def sort_versions!(versions) + versions.sort! + end end def pdf_new_page?(options) -- cgit v1.2.3