Commit 0e14a2f2 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Add commment to Issue, Project and MergeRequest #to_reference

parent 660a755c
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment