internetee-registry/app/models/account_activity.rb
2015-04-17 12:39:09 +03:00

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