mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Track account balance dynamically in AccountActivity
This commit is contained in:
parent
416390a3c4
commit
27e441bc24
4 changed files with 19 additions and 3 deletions
|
@ -13,6 +13,9 @@ class AccountActivity < ApplicationRecord
|
|||
def update_balance
|
||||
account.balance += sum
|
||||
account.save
|
||||
|
||||
self.new_balance = account.balance
|
||||
save
|
||||
end
|
||||
|
||||
class << self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue