Module: Golden::Setting::FormOption::ClassMethods

Defined in:
lib/golden/setting/form_option.rb

Instance Method Summary collapse

Instance Method Details

#is_true?(name) ⇒ Boolean

Returns:

  • (Boolean)

Raises:



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/golden/setting/form_option.rb', line 16

def is_true? name
  record = object(name)
  raise Error::SettingNotFound, name unless record

  case record.field_type
  when :boolean
    self[name] == '1'
  else
    self[name].present?
  end
end