Module: PerformWithKeywords

Defined in:
lib/sqewer/perform_override.rb

Overview

This module enables the acceptance of kwargs for the perform method inside of ActiveJob::Execution (only needed on ActiveJob versions < 5)

Instance Method Summary collapse

Instance Method Details

#perform_nowObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/sqewer/perform_override.rb', line 4

def perform_now
  deserialize_arguments_if_needed
  run_callbacks :perform do
    args_with_symbolized_options = arguments.map do |a|
      a.respond_to?(:symbolize_keys) ? a.symbolize_keys : a
    end
    perform(*args_with_symbolized_options)
  end
rescue => exception
  rescue_with_handler(exception) || raise(exception)
end