mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-28 09:39:39 +02:00
Enque account sync job after creating transfer (#946)
This commit is contained in:
parent
cf23453d93
commit
48092cb704
2 changed files with 2 additions and 0 deletions
|
@ -18,6 +18,7 @@ class Account::TransfersController < ApplicationController
|
||||||
name: transfer_params[:name]
|
name: transfer_params[:name]
|
||||||
|
|
||||||
if @transfer.save
|
if @transfer.save
|
||||||
|
@transfer.entries.each(&:sync_account_later)
|
||||||
redirect_to transactions_path, notice: t(".success")
|
redirect_to transactions_path, notice: t(".success")
|
||||||
else
|
else
|
||||||
# TODO: this is not an ideal way to handle errors and should eventually be improved.
|
# TODO: this is not an ideal way to handle errors and should eventually be improved.
|
||||||
|
|
|
@ -22,6 +22,7 @@ class Account::TransfersControllerTest < ActionDispatch::IntegrationTest
|
||||||
name: "Test Transfer"
|
name: "Test Transfer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert_enqueued_with job: AccountSyncJob
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue