Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
ba5e98bb
Commit
ba5e98bb
authored
Nov 24, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport Note#commands_changes from EE
parent
d0c0c75c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
app/controllers/projects/notes_controller.rb
app/controllers/projects/notes_controller.rb
+1
-0
app/models/note.rb
app/models/note.rb
+3
-0
app/services/notes/create_service.rb
app/services/notes/create_service.rb
+2
-0
No files found.
app/controllers/projects/notes_controller.rb
View file @
ba5e98bb
...
...
@@ -197,6 +197,7 @@ class Projects::NotesController < Projects::ApplicationController
)
end
attrs
[
:commands_changes
]
=
note
.
commands_changes
unless
attrs
[
:award
]
attrs
end
...
...
app/models/note.rb
View file @
ba5e98bb
...
...
@@ -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
...
...
app/services/notes/create_service.rb
View file @
ba5e98bb
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment