Module: Referable

Extended by:
ActiveSupport::Concern
Included in:
Commit, CommitRange, ExternalIssue, Group, Issue, Label, MergeRequest, Milestone, Project, Snippet, User
Defined in:
app/models/concerns/referable.rb

Overview

Referable concern

Contains functionality related to making a model referable in Markdown, such as “#1”, “!2”, “~3”, etc.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details


24
25
26
# File 'app/models/concerns/referable.rb', line 24

def reference_link_text(from_project = nil)
  to_reference(from_project)
end

#to_reference(_from_project = nil) ⇒ Object

Returns the String necessary to reference this object in Markdown

from_project - Refering Project object

This should be overridden by the including class.

Examples:

Issue.first.to_reference               # => "#1"
Issue.last.to_reference(other_project) # => "cross-project#1"

Returns a String


20
21
22
# File 'app/models/concerns/referable.rb', line 20

def to_reference(_from_project = nil)
  ''
end