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


10
11
12
# File 'app/models/financial_transaction_class.rb', line 10

def self.has_multiple_classes
  FinancialTransactionClass.count > 1
end

Instance Method Details

#displayObject


14
15
16
17
18
19
20
# File 'app/models/financial_transaction_class.rb', line 14

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