app/concepts/bloom_remit/txns/operations/create.rb in bloom_remit-0.0.1 vs app/concepts/bloom_remit/txns/operations/create.rb in bloom_remit-0.1.0
- old
+ new
@@ -7,16 +7,26 @@
model Txn, :create
contract Contracts::Create
include Dispatch
- callback :after_create, Callbacks::AfterCreate
+ callback :after_create do
+ on_change :after_create
+ end
def process(params)
validate(params[:txn]) do |f|
f.model.secret = SecureRandom.uuid
f.save
dispatch! :after_create
+ end
+ end
+
+ private
+
+ def after_create(form, opts)
+ ActiveRecord::Base.after_transaction do
+ PayoutJob.perform_async(form.model.id)
end
end
end
end