Commit 43cad71f authored by Alex Denisov's avatar Alex Denisov
Browse files

Duplicate code removed from IssueObserver#after_update

parent 0945fc73cdea
...@@ -10,17 +10,13 @@ def after_create(issue) ...@@ -10,17 +10,13 @@ def after_create(issue)
def after_update(issue) def after_update(issue)
send_reassigned_email(issue) if issue.is_being_reassigned? send_reassigned_email(issue) if issue.is_being_reassigned?
if issue.is_being_closed? status = nil
Note.create_status_change_note(issue, current_user, 'closed') status = 'closed' if issue.is_being_closed?
status = 'reopened' if issue.is_being_reopened?
if status
Note.create_status_change_note(issue, current_user, status)
[, issue.assignee].compact.each do |recipient| [, issue.assignee].compact.each do |recipient|
Notify.issue_status_changed_email(,, 'closed', current_user) Notify.issue_status_changed_email(,, status, current_user)
if issue.is_being_reopened?
Note.create_status_change_note(issue, current_user, 'reopened')
[, issue.assignee].compact.each do |recipient|
Notify.issue_status_changed_email(,, 'reopened', current_user)
end end
end end
end end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment