diff --git a/app/models/issue.rb b/app/models/issue.rb index ab7473d23c3..d8826b65fcc 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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}" diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 67d4c70dc3a..082adcafcc8 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -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}" diff --git a/app/models/project.rb b/app/models/project.rb index 23b98916b2e..4396ea9ef36 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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