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:
authorMarin Jankovski <maxlazio@gmail.com>2015-02-03 02:11:19 +0300
committerMarin Jankovski <maxlazio@gmail.com>2015-02-11 20:21:57 +0300
commit29e606deeca83c41d72f880d9574af5983686ab3 (patch)
tree9dfca41ccb3ae3a3c075d1b217e206a98bebf8ec /app/models/external_issue.rb
parent2dfd21983483bd5fd32b327edb4b02228b377c47 (diff)
Add ExternalIssue base model to make issue referencing more robust for external issue trackers.
Diffstat (limited to 'app/models/external_issue.rb')
-rw-r--r--app/models/external_issue.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/models/external_issue.rb b/app/models/external_issue.rb
new file mode 100644
index 00000000000..50efcb32f1b
--- /dev/null
+++ b/app/models/external_issue.rb
@@ -0,0 +1,25 @@
+class ExternalIssue
+ def initialize(issue_identifier, project)
+ @issue_identifier, @project = issue_identifier, project
+ end
+
+ def to_s
+ @issue_identifier.to_s
+ end
+
+ def id
+ @issue_identifier.to_s
+ end
+
+ def iid
+ @issue_identifier.to_s
+ end
+
+ def ==(other)
+ other.is_a?(self.class) && (to_s == other.to_s)
+ end
+
+ def project
+ @project
+ end
+end