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
This commit is contained in:
commit
b3e1561fde
3 changed files with 6 additions and 0 deletions
|
@ -197,6 +197,7 @@ class Projects::NotesController < Projects::ApplicationController
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
attrs[:commands_changes] = note.commands_changes unless attrs[:award]
|
||||||
attrs
|
attrs
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,9 @@ class Note < ActiveRecord::Base
|
||||||
# Banzai::ObjectRenderer
|
# Banzai::ObjectRenderer
|
||||||
attr_accessor :user_visible_reference_count
|
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
|
default_value_for :system, false
|
||||||
|
|
||||||
attr_mentionable :note, pipeline: :note
|
attr_mentionable :note, pipeline: :note
|
||||||
|
|
|
@ -43,6 +43,8 @@ module Notes
|
||||||
if only_commands
|
if only_commands
|
||||||
note.errors.add(:commands_only, 'Your commands have been executed!')
|
note.errors.add(:commands_only, 'Your commands have been executed!')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
note.commands_changes = command_params.keys
|
||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
|
|
Loading…
Reference in a new issue