Sha256: f3717c11864661745ebede5bbd20211e64017c3d40cfdae38a724e5e48f5ae5e

Contents?: true

Size: 805 Bytes

Versions: 14

Compression:

Stored size: 805 Bytes

Contents

module ActiveJobHelpers
  def active_job_args_wrapper(args: [], params: nil)
    if (DependencyHelper.rails6_1_present? && DependencyHelper.ruby_3_1_or_newer?) || DependencyHelper.rails7_present?
      wrapped_args = {}

      if params
        if DependencyHelper.rails7_present?
          wrapped_args["_aj_ruby2_keywords"] = ["params", "args"]
          wrapped_args["args"] = []
          wrapped_args["params"] = {
            "_aj_symbol_keys" => ["foo"]
          }.merge(params)
        else
          wrapped_args["_aj_symbol_keys"] = ["foo"]
          wrapped_args.merge!(params)
        end
      else
        wrapped_args["_aj_ruby2_keywords"] = ["args"]
        wrapped_args["args"] = args
      end

      [wrapped_args]
    else
      params.nil? ? args : args + [params]
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
appsignal-3.0.24-java spec/support/helpers/activejob_helpers.rb
appsignal-3.0.24 spec/support/helpers/activejob_helpers.rb
appsignal-3.0.23-java spec/support/helpers/activejob_helpers.rb
appsignal-3.0.23 spec/support/helpers/activejob_helpers.rb
appsignal-3.0.22-java spec/support/helpers/activejob_helpers.rb
appsignal-3.0.22 spec/support/helpers/activejob_helpers.rb
appsignal-3.0.21-java spec/support/helpers/activejob_helpers.rb
appsignal-3.0.21 spec/support/helpers/activejob_helpers.rb
appsignal-3.0.21.alpha.1-java spec/support/helpers/activejob_helpers.rb
appsignal-3.0.21.alpha.1 spec/support/helpers/activejob_helpers.rb
appsignal-3.0.20-java spec/support/helpers/activejob_helpers.rb
appsignal-3.0.20 spec/support/helpers/activejob_helpers.rb
appsignal-3.0.19-java spec/support/helpers/activejob_helpers.rb
appsignal-3.0.19 spec/support/helpers/activejob_helpers.rb