Class: FinancialLink
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- FinancialLink
- Defined in:
- app/models/financial_link.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.first_unused_or_create ⇒ Object
37 38 39 |
# File 'app/models/financial_link.rb', line 37 def self.first_unused_or_create unused.first || create end |
Instance Method Details
#amount ⇒ Object
41 42 43 |
# File 'app/models/financial_link.rb', line 41 def amount bank_transactions.sum(:amount) + invoices.sum(:amount) - financial_transactions.sum(:amount) end |