Add method to Note to create notes about status changes.
This commit is contained in:
parent
00ec81eacb
commit
02924de3e1
2 changed files with 27 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue