Class: BankAccount
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- BankAccount
- Defined in:
- app/models/bank_account.rb
Instance Method Summary collapse
- #assign_unlinked_transactions ⇒ Object
-
#find_connector ⇒ Function
Method wich can be called to import transaction from a bank or nil if unsupported.
- #last_transaction_date ⇒ Object
Instance Method Details
#assign_unlinked_transactions ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/models/bank_account.rb', line 19 def assign_unlinked_transactions count = 0 bank_transactions.without_financial_link.includes(:supplier, :user).find_each do |t| count += 1 if t.assign_to_ordergroup || t.assign_to_invoice end count end |
#find_connector ⇒ Function
Returns Method wich can be called to import transaction from a bank or nil if unsupported.
14 15 16 17 |
# File 'app/models/bank_account.rb', line 14 def find_connector klass = BankAccountConnector.find iban klass.new self if klass end |
#last_transaction_date ⇒ Object
27 28 29 |
# File 'app/models/bank_account.rb', line 27 def last_transaction_date bank_transactions.order(date: :desc).first&.date end |