Sha256: 050213917d534cb70ed571397d6e0f0fecd9924c3e42e2350989dca5dfdacf5a

Contents?: true

Size: 348 Bytes

Versions: 1

Compression:

Stored size: 348 Bytes

Contents

# frozen_string_literal: true

module GoodJob
  module ActiveJobExtensions
    module Batches
      extend ActiveSupport::Concern

      def batch
        @_batch ||= CurrentThread.execution&.batch&.to_batch if CurrentThread.execution.present? && CurrentThread.execution.active_job_id == job_id
      end
      alias batch? batch
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
good_job-3.28.1 lib/good_job/active_job_extensions/batches.rb