class OrderQueueProcessorJob < ApplicationJob queue_as :default def perform(order_id, table_id) # Do something later #Order ID order = Order.find(order_id) #Loop through the order stations and process the items #Execute orders and send to order stations if order oqs = OrderQueueStation.new oqs.process_order(order, table_id) end end end