mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44: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
|
||||
if @account.valid?
|
||||
@sum = params[:account][:balance].to_f - @account.balance
|
||||
action = Actions::AccountActivityCreate.new(@account,
|
||||
@sum,
|
||||
params[:description],
|
||||
action = Actions::AccountActivityCreate.new(@account, @sum, params[:description],
|
||||
AccountActivity::UPDATE_CREDIT)
|
||||
|
||||
unless action.call
|
||||
handle_errors(@account)
|
||||
render 'edit'
|
||||
end
|
||||
redirect_to admin_accounts_path, notice: t('.updated')
|
||||
else
|
||||
render 'edit'
|
||||
redirect_to admin_accounts_path, notice: t('.updated') if action.call
|
||||
end
|
||||
|
||||
render 'edit'
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue