Class: FinancialTransactionClass

Inherits:
ApplicationRecord show all
Defined in:
app/models/financial_transaction_class.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.has_multiple_classesObject



14
15
16
# File 'app/models/financial_transaction_class.rb', line 14

def self.has_multiple_classes
  FinancialTransactionClass.count > 1
end

Instance Method Details

#displayObject



18
19
20
21
22
23
24
# File 'app/models/financial_transaction_class.rb', line 18

def display
  if FinancialTransactionClass.has_multiple_classes
    name
  else
    I18n.t('activerecord.attributes.financial_transaction.amount')
  end
end