Add commment to Issue, Project and MergeRequest #to_reference
This commit is contained in:
parent
660a755cad
commit
0e14a2f21d
3 changed files with 3 additions and 0 deletions
|
@ -97,6 +97,7 @@ class Issue < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
# `from` argument can be a Namespace or Project.
|
||||
def to_reference(from = nil, full: false)
|
||||
reference = "#{self.class.reference_prefix}#{iid}"
|
||||
|
||||
|
|
|
@ -179,6 +179,7 @@ class MergeRequest < ActiveRecord::Base
|
|||
work_in_progress?(title) ? title : "WIP: #{title}"
|
||||
end
|
||||
|
||||
# `from` argument can be a Namespace or Project.
|
||||
def to_reference(from = nil, full: false)
|
||||
reference = "#{self.class.reference_prefix}#{iid}"
|
||||
|
||||
|
|
|
@ -591,6 +591,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
# `from` argument can be a Namespace or Project.
|
||||
def to_reference(from = nil, full: false)
|
||||
if full || cross_namespace_reference?(from)
|
||||
path_with_namespace
|
||||
|
|
Loading…
Reference in a new issue