Class: FinancialTransaction

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/financial_transaction.rb

Overview

financial transactions are the foodcoop internal financial transactions only ordergroups have an account balance and are happy to transfer money

Instance Method Summary collapse

Instance Method Details

#add_transaction!Object

Use this save method instead of simple save and after callback


22
23
24
# File 'app/models/financial_transaction.rb', line 22

def add_transaction!
  ordergroup.add_financial_transaction! amount, note, user, financial_transaction_type
end

#initialize_financial_transaction_typeObject (protected)


28
29
30
# File 'app/models/financial_transaction.rb', line 28

def initialize_financial_transaction_type
  self.financial_transaction_type ||= FinancialTransactionType.default
end