Add method to Note to create notes about status changes.

This commit is contained in:
Robb Kidd 2012-05-20 14:35:03 -04:00
parent 00ec81eacb
commit 02924de3e1
2 changed files with 27 additions and 0 deletions

View file

@ -42,6 +42,14 @@ class Note < ActiveRecord::Base
mount_uploader :attachment, AttachmentUploader
def self.create_status_change_note(noteable, author, status)
create({ :noteable => noteable,
:project => noteable.project,
:author => author,
:note => "_Status changed to #{status}_" },
:without_protection => true)
end
def notify
@notify ||= false
end