mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
added action
This commit is contained in:
parent
d25847571f
commit
43518b5832
3 changed files with 26 additions and 6 deletions
|
@ -16,12 +16,12 @@ module Admin
|
|||
|
||||
def update
|
||||
if @account.valid?
|
||||
@sum = params[:account][:balance].to_f - @account.balance
|
||||
action = Actions::AccountActivityCreate.new(@account, @sum, params[:description],
|
||||
AccountActivity::UPDATE_CREDIT)
|
||||
redirect_to admin_accounts_path, notice: t('.updated') if action.call
|
||||
action = Actions::AccountActivityCreate.new(@account, params[:account][:balance],
|
||||
params[:description], AccountActivity::UPDATE_CREDIT)
|
||||
redirect_to admin_accounts_path, notice: t('.updated') and return if action.call
|
||||
end
|
||||
|
||||
flash[:alert] = t('invalid_balance')
|
||||
render 'edit'
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue