diff options
author | Nikita Verkhovin <vernik91@gmail.com> | 2015-02-07 17:14:55 +0600 |
---|---|---|
committer | Nikita Verkhovin <vernik91@gmail.com> | 2015-02-08 22:35:41 +0600 |
commit | 8681cb3137511e51e19f76aef9839be28f8fcd6a (patch) | |
tree | f2d5a929763d77b12c4248cc1bb50a01766bcbfe /app/services/issues/update_service.rb | |
parent | 0a34f2dcb562098c481140246f7ac22683b38d76 (diff) | |
download | gitlab-ce-8681cb3137511e51e19f76aef9839be28f8fcd6a.tar.gz |
Add labels notes
Diffstat (limited to 'app/services/issues/update_service.rb')
-rw-r--r-- | app/services/issues/update_service.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/services/issues/update_service.rb b/app/services/issues/update_service.rb index 83e413d7248..c61d67a7893 100644 --- a/app/services/issues/update_service.rb +++ b/app/services/issues/update_service.rb @@ -14,10 +14,17 @@ module Issues issue.update_nth_task(params[:task_num].to_i, false) end + old_labels = issue.labels.to_a + if params.present? && issue.update_attributes(params.except(:state_event, :task_num)) issue.reset_events_cache + if issue.labels != old_labels + create_labels_note( + issue, issue.labels - old_labels, old_labels - issue.labels) + end + if issue.previous_changes.include?('milestone_id') create_milestone_note(issue) end |