Method: ActiveSetting::Setting.convert_value
- Defined in:
- lib/active_setting/setting.rb
.convert_value(val, data_type) ⇒ Object
92 93 94 95 96 97 98 99 100 101 |
# File 'lib/active_setting/setting.rb', line 92 def self.convert_value(val, data_type) case data_type when :boolean then ![nil, false, 'false', 0, '0'].include?(val) when :integer then val.to_i when :string then val.to_s when :symbol then val.to_sym when :decimal then BigDecimal(val) else val end end |