summaryrefslogtreecommitdiff
path: root/app/models/sentry_issue.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 21:08:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 21:08:24 +0000
commit727b1a890c8e44440414c59611e9ead34d6edc93 (patch)
treede5f272452d2ee4d3e2edb90936fe7ecca127431 /app/models/sentry_issue.rb
parentaa0f0e992153e84e1cdec8a1c7310d5eb93a9f8f (diff)
downloadgitlab-ce-727b1a890c8e44440414c59611e9ead34d6edc93.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/sentry_issue.rb')
-rw-r--r--app/models/sentry_issue.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/models/sentry_issue.rb b/app/models/sentry_issue.rb
index 6be52f99562..e60ad6015a5 100644
--- a/app/models/sentry_issue.rb
+++ b/app/models/sentry_issue.rb
@@ -4,7 +4,11 @@ class SentryIssue < ApplicationRecord
belongs_to :issue
validates :issue, uniqueness: true, presence: true
- validates :sentry_issue_identifier,
- uniqueness: true,
- presence: true
+ validates :sentry_issue_identifier, presence: true
+
+ def self.for_project_and_identifier(project, identifier)
+ joins(:issue)
+ .where(issues: { project_id: project.id })
+ .find_by_sentry_issue_identifier(identifier)
+ end
end