diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-16 21:08:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-16 21:08:24 +0000 |
commit | 727b1a890c8e44440414c59611e9ead34d6edc93 (patch) | |
tree | de5f272452d2ee4d3e2edb90936fe7ecca127431 /app/models/sentry_issue.rb | |
parent | aa0f0e992153e84e1cdec8a1c7310d5eb93a9f8f (diff) | |
download | gitlab-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.rb | 10 |
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 |