issue project 为nil时的特殊处理
This commit is contained in:
parent
a303f3d01b
commit
f9f0485e50
|
@ -187,7 +187,11 @@ class Issue < ApplicationRecord
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
def get_issue_tags_name
|
||||
|
@ -229,7 +233,7 @@ class Issue < ApplicationRecord
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
def send_update_message_to_notice_system
|
||||
|
|
Loading…
Reference in New Issue