Add activity type field #2691

This commit is contained in:
Martin Lensment 2015-07-06 13:02:19 +03:00
parent fa4a2d2987
commit d6a151b141
9 changed files with 45 additions and 67 deletions

View file

@ -4,6 +4,10 @@ class AccountActivity < ActiveRecord::Base
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