summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-11-24 09:02:01 +0000
committerDouwe Maan <douwe@gitlab.com>2016-11-24 09:02:01 +0000
commitb3e1561fdea263a991076af1114aca68d66140aa (patch)
treecfde8f4567ba9a2c6f31d425fe0b84689c45d15b
parent3943e632103271b3683e0cc355f0fef4c9452491 (diff)
parentba5e98bb701672d0cf1d98a80272c16a754ec83c (diff)
downloadgitlab-ce-b3e1561fdea263a991076af1114aca68d66140aa.tar.gz
Merge branch 'backport-commands-params' into 'master'
Backport Note#commands_changes from EE One small thing from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/870 that was missed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7604. /cc @rdavila See merge request !7730
-rw-r--r--app/controllers/projects/notes_controller.rb1
-rw-r--r--app/models/note.rb3
-rw-r--r--app/services/notes/create_service.rb2
3 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb
index f029fde2a2f..15ca080c696 100644
--- a/app/controllers/projects/notes_controller.rb
+++ b/app/controllers/projects/notes_controller.rb
@@ -197,6 +197,7 @@ class Projects::NotesController < Projects::ApplicationController
)
end
+ attrs[:commands_changes] = note.commands_changes unless attrs[:award]
attrs
end
diff --git a/app/models/note.rb b/app/models/note.rb
index 9ff5e308ed2..ed4224e3046 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -19,6 +19,9 @@ class Note < ActiveRecord::Base
# Banzai::ObjectRenderer
attr_accessor :user_visible_reference_count
+ # Attribute used to store the attributes that have ben changed by slash commands.
+ attr_accessor :commands_changes
+
default_value_for :system, false
attr_mentionable :note, pipeline: :note
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb
index 7935fabe2da..d75592e31f3 100644
--- a/app/services/notes/create_service.rb
+++ b/app/services/notes/create_service.rb
@@ -43,6 +43,8 @@ module Notes
if only_commands
note.errors.add(:commands_only, 'Your commands have been executed!')
end
+
+ note.commands_changes = command_params.keys
end
note