[
issues.minimum('start_date'),
shared_versions.collect(&:effective_date),
- shared_versions.collect {|v| v.fixed_issues.minimum('start_date')}
+ shared_versions.collect(&:start_date)
].flatten.compact.min
end
end
def start_date
- effective_date
+ @start_date ||= fixed_issues.minimum('start_date')
end
def due_date
def behind_schedule?
if completed_pourcent == 100
return false
- elsif due_date && fixed_issues.present? && fixed_issues.minimum('start_date') # TODO: should use #start_date but that method is wrong...
- start_date = fixed_issues.minimum('start_date')
+ elsif due_date && start_date
done_date = start_date + ((due_date - start_date+1)* completed_pourcent/100).floor
return done_date <= Date.today
else
options[:zoom] ||= 1
options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom]
- coords = coordinates(version.fixed_issues.minimum('start_date'), version.due_date, version.completed_pourcent, options[:zoom])
+ coords = coordinates(version.start_date, version.due_date, version.completed_pourcent, options[:zoom])
label = "#{h version } #{h version.completed_pourcent.to_i.to_s}%"
label = h("#{version.project} -") + label unless @project && @project == version.project