Class: SentryIssue
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- SentryIssue
- Includes:
- Importable
- Defined in:
- app/models/sentry_issue.rb
Constant Summary
Constants inherited from ApplicationRecord
Constants included from HasCheckConstraints
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
Constants included from ResetOnColumnErrors
ResetOnColumnErrors::MAX_RESET_PERIOD
Instance Attribute Summary
Attributes included from Importable
#importing, #user_contributions
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ApplicationRecord
===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, 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
Methods included from Organizations::Sharding
Methods included from ResetOnColumnErrors
#reset_on_union_error, #reset_on_unknown_attribute_error
Methods included from Gitlab::SensitiveSerializableHash
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
29 30 31 |
# File 'app/models/sentry_issue.rb', line 29 def enqueue_sentry_sync_job ErrorTrackingIssueLinkWorker.perform_async(issue.id) end |
#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? # Custom message because field is hidden errors.add(:_, _('is already associated to a GitLab Issue. New issue will not be associated.')) end end |