class ErpProductJob < ApplicationJob queue_as :default def perform event:, method_name: erp_event = ErpEvent.new products = event.payload[:products] erp_event.name = event.omnes_event_name erp_event.method = method_name erp_event.body = products.to_json erp_event.save! end end