Sha256: 8cc1d9ff38de7dcf61824a3b14e6775ed92361661e497252cf6cf704af1dadd9

Contents?: true

Size: 552 Bytes

Versions: 5

Compression:

Stored size: 552 Bytes

Contents

module Webhooks::Outgoing::TeamSupport
  extend ActiveSupport::Concern

  included do
    has_many :webhooks_outgoing_endpoints, class_name: "Webhooks::Outgoing::Endpoint", dependent: :destroy
    has_many :webhooks_outgoing_events, class_name: "Webhooks::Outgoing::Event", dependent: :destroy

    before_destroy :mark_for_destruction, prepend: true
  end

  def mark_for_destruction
    # This allows downstream logic to check whether a team is being destroyed in order to bypass webhook issuance.
    update_column(:being_destroyed, true)
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
bullet_train-outgoing_webhooks-1.0.4 app/models/concerns/webhooks/outgoing/team_support.rb
bullet_train-outgoing_webhooks-core-1.0.3 app/models/concerns/webhooks/outgoing/team_support.rb
bullet_train-outgoing_webhooks-core-1.0.2 app/models/concerns/webhooks/outgoing/team_support.rb
bullet_train-outgoing_webhooks-1.0.1 lib/models/concerns/webhooks/outgoing/team_support.rb
bullet_train-outgoing_webhooks-1.0.0 lib/models/concerns/webhooks/outgoing/team_support.rb