Commit e5621294 authored by Cedric Gatay's avatar Cedric Gatay

Added note when issue status changed (closed / reopened)

Implementation is correctly done through observer.
parent 78d88262
...@@ -71,5 +71,11 @@ class MailerObserver < ActiveRecord::Observer ...@@ -71,5 +71,11 @@ class MailerObserver < ActiveRecord::Observer
end end
end end
end if issue.closed_changed?
note = Note.new(:noteable => issue, :project => issue.project)
note.author = current_user
note.note = "_Status changed to #{issue.closed ? 'closed' : 'reopened'}_"
note.save()
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