diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-10-11 18:37:19 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-11-07 14:49:24 +0300 |
commit | 24261f2dbd50583ac997c3f53f78104a96fa2cd3 (patch) | |
tree | 2b4392e71d5136483f8ffa70d289b16a5b98940e /app/models | |
parent | 467b346f0684053081d7e762df1a2b5df5888543 (diff) |
Add the method ExternalIssue#project_id
This method returns the project's ID, making ExternalIssue slightly more
compatible with Issue (which also defines the "project_id" method).
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/external_issue.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/external_issue.rb b/app/models/external_issue.rb index fd9a8c1b8b7..91b508eb325 100644 --- a/app/models/external_issue.rb +++ b/app/models/external_issue.rb @@ -29,6 +29,15 @@ class ExternalIssue @project end + def project_id + @project.id + end + + # Pattern used to extract `JIRA-123` issue references from text + def self.reference_pattern + @reference_pattern ||= %r{(?<issue>\b([A-Z][A-Z0-9_]+-)\d+)} + end + def to_reference(_from_project = nil) id end |