Module: ActiveadminSettings::SettingMethods::ClassMethods

Defined in:
app/models/activeadmin_settings/setting.rb

Overview

Class

Instance Method Summary collapse

Instance Method Details

#initiate_setting(name) ⇒ Object



17
18
19
20
21
22
23
24
# File 'app/models/activeadmin_settings/setting.rb', line 17

def initiate_setting(name)
  s = self.new(name: name)
  if s.type == "text" or s.type == "html"
    s.string = s.default_value
  end
  s.save
  s
end