Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-05-03 06:11:21 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-05-26 22:48:30 +0300
commitc0faf91ff23815404a95cf4510b43dcf5e331c4f (patch)
tree81769f125569dd6ea012920544ada1e8666ba4e5 /app/models/external_issue.rb
parentb06dc74d611192744d34acda944d7ed9e554342a (diff)
Add `to_reference` for models that support references
Now there is a single source of information for which attribute a model uses to be referenced, and its special character.
Diffstat (limited to 'app/models/external_issue.rb')
-rw-r--r--app/models/external_issue.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/external_issue.rb b/app/models/external_issue.rb
index 85fdb12bfdc..6fda4a2ab77 100644
--- a/app/models/external_issue.rb
+++ b/app/models/external_issue.rb
@@ -1,4 +1,6 @@
class ExternalIssue
+ include Referable
+
def initialize(issue_identifier, project)
@issue_identifier, @project = issue_identifier, project
end
@@ -7,6 +9,10 @@ class ExternalIssue
@issue_identifier.to_s
end
+ def to_reference(_from_project = nil)
+ id
+ end
+
def id
@issue_identifier.to_s
end