summaryrefslogtreecommitdiff
path: root/app/models/sentry_issue.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/sentry_issue.rb')
-rw-r--r--app/models/sentry_issue.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/sentry_issue.rb b/app/models/sentry_issue.rb
index e60ad6015a5..1325bce6c43 100644
--- a/app/models/sentry_issue.rb
+++ b/app/models/sentry_issue.rb
@@ -6,9 +6,15 @@ class SentryIssue < ApplicationRecord
validates :issue, uniqueness: true, presence: true
validates :sentry_issue_identifier, presence: true
+ after_create_commit :enqueue_sentry_sync_job
+
def self.for_project_and_identifier(project, identifier)
joins(:issue)
.where(issues: { project_id: project.id })
.find_by_sentry_issue_identifier(identifier)
end
+
+ def enqueue_sentry_sync_job
+ ErrorTrackingIssueLinkWorker.perform_async(issue.id)
+ end
end