Skip to content
Snippets Groups Projects
Commit d9a131a6 authored by Robert Speicher's avatar Robert Speicher
Browse files

Delegate a Note's Mentionable methods to its noteable object

Former-commit-id: 84dab62c
parent 906d5832
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -39,6 +39,7 @@ class Note < ActiveRecord::Base
 
has_many :todos, dependent: :destroy
 
delegate :gfm_reference, :local_reference, to: :noteable
delegate :name, to: :project, prefix: true
delegate :name, :email, to: :author, prefix: true
 
Loading
Loading
@@ -313,16 +314,6 @@ class Note < ActiveRecord::Base
nil
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
noteable_type.downcase if noteable_type.present?
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment