Class: AskIt::Section

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

Instance Method Summary collapse

Instance Method Details

#descriptionObject



32
33
34
35
36
37
38
# File 'app/models/ask_it/section.rb', line 32

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

#full_nameObject



48
49
50
51
# File 'app/models/ask_it/section.rb', line 48

def full_name
  head_name = head_number.blank? ? '' : "#{head_number}: "
  "#{head_name}#{name}"
end

#head_numberObject



40
41
42
43
44
45
46
# File 'app/models/ask_it/section.rb', line 40

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

#nameObject



24
25
26
27
28
29
30
# File 'app/models/ask_it/section.rb', line 24

def name
  if I18n.locale == I18n.default_locale
    super
  else
    locale_name.blank? ? super : locale_name
  end
end