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
84dab62c
Commit
84dab62c
authored
Mar 05, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delegate a Note's Mentionable methods to its noteable object
parent
9bbf873e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
10 deletions
+1
-10
app/models/note.rb
app/models/note.rb
+1
-10
No files found.
app/models/note.rb
View file @
84dab62c
...
@@ -39,6 +39,7 @@ class Note < ActiveRecord::Base
...
@@ -39,6 +39,7 @@ class Note < ActiveRecord::Base
has_many
:todos
,
dependent: :destroy
has_many
:todos
,
dependent: :destroy
delegate
:gfm_reference
,
:local_reference
,
to: :noteable
delegate
:name
,
to: :project
,
prefix:
true
delegate
:name
,
to: :project
,
prefix:
true
delegate
:name
,
:email
,
to: :author
,
prefix:
true
delegate
:name
,
:email
,
to: :author
,
prefix:
true
...
@@ -313,16 +314,6 @@ class Note < ActiveRecord::Base
...
@@ -313,16 +314,6 @@ class Note < ActiveRecord::Base
nil
nil
end
end
# Mentionable override.
def
gfm_reference
(
from_project
=
nil
)
noteable
.
gfm_reference
(
from_project
)
end
# Mentionable override.
def
local_reference
noteable
end
def
noteable_type_name
def
noteable_type_name
noteable_type
.
downcase
if
noteable_type
.
present?
noteable_type
.
downcase
if
noteable_type
.
present?
end
end
...
...
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