module Sentry::Rails::ActiveJobExtensions

def self.included(base)

def self.included(base)
  base.class_eval do
    around_perform do |job, block|
      if Sentry.initialized?
        if already_supported_by_specific_integration?(job)
          block.call
        else
          Sentry.with_scope do |scope|
            capture_and_reraise_with_sentry(job, scope, block)
          end
        end
      else
        block.call
      end
    end
  end
end