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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
93d0bacf
Commit
93d0bacf
authored
Oct 26, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove EE-specific code from DiscussionNote
parent
359474a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
app/models/concerns/noteable.rb
app/models/concerns/noteable.rb
+1
-1
app/models/diff_note.rb
app/models/diff_note.rb
+4
-2
app/models/discussion_note.rb
app/models/discussion_note.rb
+4
-2
No files found.
app/models/concerns/noteable.rb
View file @
93d0bacf
...
...
@@ -23,7 +23,7 @@ module Noteable
end
def
supports_discussions?
DiscussionNote
::
NOTEABLE_TYPES
.
include?
(
base_class_name
)
DiscussionNote
.
noteable_types
.
include?
(
base_class_name
)
end
def
discussions_rendered_on_frontend?
...
...
app/models/diff_note.rb
View file @
93d0bacf
...
...
@@ -8,12 +8,14 @@ class DiffNote < Note
include
DiffPositionableNote
include
Gitlab
::
Utils
::
StrongMemoize
NOTEABLE_TYPES
=
%w(MergeRequest Commit)
.
freeze
def
self
.
noteable_types
%w(MergeRequest Commit)
end
validates
:original_position
,
presence:
true
validates
:position
,
presence:
true
validates
:line_code
,
presence:
true
,
line_code:
true
,
if: :on_text?
validates
:noteable_type
,
inclusion:
{
in:
NOTEABLE_TYPES
}
validates
:noteable_type
,
inclusion:
{
in:
noteable_types
}
validate
:positions_complete
validate
:verify_supported
validate
:diff_refs_match_commit
,
if: :for_commit?
...
...
app/models/discussion_note.rb
View file @
93d0bacf
...
...
@@ -5,9 +5,11 @@
# A note of this type can be resolvable.
class
DiscussionNote
<
Note
# Names of all implementers of `Noteable` that support discussions.
NOTEABLE_TYPES
=
%w(MergeRequest Issue Commit Snippet)
.
freeze
def
self
.
noteable_types
%w(MergeRequest Issue Commit Snippet)
end
validates
:noteable_type
,
inclusion:
{
in:
NOTEABLE_TYPES
}
validates
:noteable_type
,
inclusion:
{
in:
noteable_types
}
def
discussion_class
(
*
)
Discussion
...
...
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