Class: Effective::CpdAuditLevelQuestion

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

Constant Summary collapse

CATEGORIES =
[
  'Choose one',   # Radios
  'Select all that apply', # Checks
  'Select up to 1',
  'Select up to 2',
  'Select up to 3',
  'Select up to 4',
  'Select up to 5',
  'Date',         # Date Field
  'Email',        # Email Field
  'Number',       # Numeric Field
  'Long Answer',  # Text Area
  'Short Answer', # Text Field
  'Upload File'   # File field
]
WITH_OPTIONS_CATEGORIES =
[
  'Choose one',   # Radios
  'Select all that apply', # Checks
  'Select up to 1',
  'Select up to 2',
  'Select up to 3',
  'Select up to 4',
  'Select up to 5'
]

Instance Method Summary collapse

Instance Method Details

#category_partialObject



82
83
84
# File 'app/models/effective/cpd_audit_level_question.rb', line 82

def category_partial
  category.to_s.parameterize.underscore
end

#question_option?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'app/models/effective/cpd_audit_level_question.rb', line 78

def question_option?
  WITH_OPTIONS_CATEGORIES.include?(category)
end

#to_sObject



86
87
88
# File 'app/models/effective/cpd_audit_level_question.rb', line 86

def to_s
  title.presence || model_name.human
end