mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
13 lines
245 B
Ruby
13 lines
245 B
Ruby
class AccountActivity < ActiveRecord::Base
|
|
include Versions
|
|
belongs_to :account
|
|
belongs_to :bank_transaction
|
|
belongs_to :invoice
|
|
|
|
after_create :update_balance
|
|
def update_balance
|
|
account.balance += sum
|
|
account.save
|
|
end
|
|
end
|
|
|