BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
notes_controller.rb
app/controllers/projects/notes_controller.rb
+1
-0
note.rb
app/models/note.rb
+3
-0
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
...
@@ -197,6 +197,7 @@ class Projects::NotesController < Projects::ApplicationController
)
)
end
end
attrs
[
:commands_changes
]
=
note
.
commands_changes
unless
attrs
[
:award
]
attrs
attrs
end
end
...
...
app/models/note.rb
View file @
ba5e98bb
...
@@ -19,6 +19,9 @@ class Note < ActiveRecord::Base
...
@@ -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
...
...
app/services/notes/create_service.rb
View file @
ba5e98bb
...
@@ -43,6 +43,8 @@ module Notes
...
@@ -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
...
...
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