Sha256: e1d803af1ec7e41788aaae2ea8861a6c3d7df664ec45905c038b0ec3334dffe7

Contents?: true

Size: 659 Bytes

Versions: 14

Compression:

Stored size: 659 Bytes

Contents

# frozen_string_literal: true

module ActiveJob
  module EnqueueAfterTransactionCommit # :nodoc:
    private
      def raw_enqueue
        after_transaction = case self.class.enqueue_after_transaction_commit
        when :always
          true
        when :never
          false
        else # :default
          queue_adapter.enqueue_after_transaction_commit?
        end

        if after_transaction
          self.successfully_enqueued = true
          ActiveRecord.after_all_transactions_commit do
            self.successfully_enqueued = false
            super
          end
          self
        else
          super
        end
      end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
activejob-7.2.2 lib/active_job/enqueue_after_transaction_commit.rb
activejob-7.2.1.2 lib/active_job/enqueue_after_transaction_commit.rb
activejob-7.2.1.1 lib/active_job/enqueue_after_transaction_commit.rb
activejob-8.0.0.beta1 lib/active_job/enqueue_after_transaction_commit.rb
omg-activejob-8.0.0.alpha9 lib/active_job/enqueue_after_transaction_commit.rb
omg-activejob-8.0.0.alpha8 lib/active_job/enqueue_after_transaction_commit.rb
omg-activejob-8.0.0.alpha7 lib/active_job/enqueue_after_transaction_commit.rb
omg-activejob-8.0.0.alpha4 lib/active_job/enqueue_after_transaction_commit.rb
omg-activejob-8.0.0.alpha3 lib/active_job/enqueue_after_transaction_commit.rb
omg-activejob-8.0.0.alpha2 lib/active_job/enqueue_after_transaction_commit.rb
omg-activejob-8.0.0.alpha1 lib/active_job/enqueue_after_transaction_commit.rb
activejob-7.2.1 lib/active_job/enqueue_after_transaction_commit.rb
activejob-7.2.0 lib/active_job/enqueue_after_transaction_commit.rb
activejob-7.2.0.rc1 lib/active_job/enqueue_after_transaction_commit.rb