mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
17 lines
312 B
Ruby
17 lines
312 B
Ruby
class AccountActivity < ActiveRecord::Base
|
|
include Versions
|
|
belongs_to :account
|
|
belongs_to :bank_transaction
|
|
belongs_to :invoice
|
|
|
|
CREATE = 'create'
|
|
RENEW = 'renew'
|
|
ADD_CREDIT = 'add_credit'
|
|
|
|
after_create :update_balance
|
|
def update_balance
|
|
account.balance += sum
|
|
account.save
|
|
end
|
|
end
|
|
|