Sha256: 5e5b59de16f7ec84029f446fe79b6aa4f14a5e981a801167c3e51ed2e5157cf5
Contents?: true
Size: 745 Bytes
Versions: 9
Compression:
Stored size: 745 Bytes
Contents
require 'interactor' module DiscoApp module Flow class CreateAction include Interactor delegate :shop, :action_id, :action_run_id, :properties, to: :context delegate :action, to: :context def call create_action enqueue_process_action_job end private def create_action context.action = shop.flow_actions.create!( action_id: action_id, action_run_id: action_run_id, properties: properties ) rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation context.fail! end def enqueue_process_action_job ProcessActionJob.perform_later(shop, action) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems