Class: SentryIssue
Constant Summary
ApplicationRecord::MAX_PLUCK
ResetOnUnionError::MAX_RESET_PERIOD
Instance Attribute Summary
Attributes included from Importable
#imported, #importing
Class Method Summary
collapse
Instance Method Summary
collapse
cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
#serializable_hash
Class Method Details
.for_project_and_identifier(project, identifier) ⇒ Object
15
16
17
18
19
20
|
# File 'app/models/sentry_issue.rb', line 15
def self.for_project_and_identifier(project, identifier)
joins(:issue)
.where(issues: { project_id: project.id })
.where(sentry_issue_identifier: identifier)
.order('issues.created_at').last
end
|
Instance Method Details
#enqueue_sentry_sync_job ⇒ Object
#ensure_sentry_issue_identifier_is_unique_per_project ⇒ Object
22
23
24
25
26
27
|
# File 'app/models/sentry_issue.rb', line 22
def ensure_sentry_issue_identifier_is_unique_per_project
if issue && self.class.for_project_and_identifier(issue.project, sentry_issue_identifier).present?
errors.add(:_, _('is already associated to a GitLab Issue. New issue will not be associated.'))
end
end
|