Merge pull request '调整check_pm_and_update_due_date' (#268) from KingChan/forgeplus:pm_project_develop into pm_project_develop
This commit is contained in:
commit
5fa1edb434
|
@ -109,8 +109,20 @@ class Issue < ApplicationRecord
|
||||||
after_destroy :update_closed_issues_count_in_project!, :decre_project_common, :decre_user_statistic, :decre_platform_statistic
|
after_destroy :update_closed_issues_count_in_project!, :decre_project_common, :decre_user_statistic, :decre_platform_statistic
|
||||||
|
|
||||||
def check_pm_and_update_due_date
|
def check_pm_and_update_due_date
|
||||||
if pm_project_id.present? && status_id.changed? && status_id == 5
|
if pm_project_id.present? && pm_issue_type.present? && status_id_chenged?
|
||||||
self.due_date = self.due_date || Time.current
|
status_ids = case pm_issue_type
|
||||||
|
when 1
|
||||||
|
[3,5]
|
||||||
|
when 2
|
||||||
|
[3,5]
|
||||||
|
when 3
|
||||||
|
[5]
|
||||||
|
else
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
if status_ids.include? self.status_id
|
||||||
|
self.due_date = self.due_date || Time.current
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue