internetee-registry/app/models/account_activity.rb
2015-07-06 13:02:19 +03:00

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