Class: FinancialTransactionClass

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.has_multiple_classesObject


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

def self.has_multiple_classes
  FinancialTransactionClass.count > 1
end

Instance Method Details

#displayObject


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

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