Merge pull request 'issue project 为nil时的特殊处理' (#211) from KingChan/forgeplus:pm_project_develop into pm_project_develop

This commit is contained in:
KingChan 2023-11-16 10:47:56 +08:00
commit c428c29042
1 changed files with 6 additions and 2 deletions

View File

@ -187,7 +187,11 @@ class Issue < ApplicationRecord
end end
def is_collaborators? def is_collaborators?
self.assigned_to_id.present? ? self.project.member?(self.assigned_to_id) : false if self.assigned_to_id.present? && self.project.present?
self.project.member?(self.assigned_to_id)
else
false
end
end end
def get_issue_tags_name def get_issue_tags_name
@ -229,7 +233,7 @@ class Issue < ApplicationRecord
end end
def update_closed_issues_count_in_project! def update_closed_issues_count_in_project!
self.project.decrement!(:closed_issues_count) if self.status_id == 5 self.project.decrement!(:closed_issues_count) if self.status_id == 5 && self.project.present?
end end
def send_update_message_to_notice_system def send_update_message_to_notice_system