mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 15:14:47 +02:00
fixed codeclimate errors
This commit is contained in:
parent
83b9c58ad3
commit
d25847571f
1 changed files with 4 additions and 11 deletions
|
@ -17,19 +17,12 @@ module Admin
|
||||||
def update
|
def update
|
||||||
if @account.valid?
|
if @account.valid?
|
||||||
@sum = params[:account][:balance].to_f - @account.balance
|
@sum = params[:account][:balance].to_f - @account.balance
|
||||||
action = Actions::AccountActivityCreate.new(@account,
|
action = Actions::AccountActivityCreate.new(@account, @sum, params[:description],
|
||||||
@sum,
|
|
||||||
params[:description],
|
|
||||||
AccountActivity::UPDATE_CREDIT)
|
AccountActivity::UPDATE_CREDIT)
|
||||||
|
redirect_to admin_accounts_path, notice: t('.updated') if action.call
|
||||||
unless action.call
|
|
||||||
handle_errors(@account)
|
|
||||||
render 'edit'
|
|
||||||
end
|
|
||||||
redirect_to admin_accounts_path, notice: t('.updated')
|
|
||||||
else
|
|
||||||
render 'edit'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
render 'edit'
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue