internetee-registry/app/models/account_activity.rb
2015-04-14 19:00:38 +03:00

12 lines
226 B
Ruby

class AccountActivity < ActiveRecord::Base
belongs_to :account
belongs_to :bank_transaction
belongs_to :invoice
after_create :update_balance
def update_balance
account.balance += sum
account.save
end
end