Class: AskIt::Question

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

Instance Method Summary collapse

Instance Method Details

#correct_optionsObject



37
38
39
# File 'app/models/ask_it/question.rb', line 37

def correct_options
  options.correct
end

#descriptionObject



53
54
55
56
57
58
59
# File 'app/models/ask_it/question.rb', line 53

def description
  if I18n.locale == I18n.default_locale
    super
  else
    locale_description.blank? ? super : locale_description
  end
end

#head_numberObject



61
62
63
64
65
66
67
# File 'app/models/ask_it/question.rb', line 61

def head_number
  if I18n.locale == I18n.default_locale
    super
  else
    locale_head_number.blank? ? super : locale_head_number
  end
end

#incorrect_optionsObject



41
42
43
# File 'app/models/ask_it/question.rb', line 41

def incorrect_options
  options.incorrect
end

#mandatory?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'app/models/ask_it/question.rb', line 69

def mandatory?
  mandatory == true
end

#textObject



45
46
47
48
49
50
51
# File 'app/models/ask_it/question.rb', line 45

def text
  if I18n.locale == I18n.default_locale
    super
  else
    locale_text.blank? ? super : locale_text
  end
end