Class: Thecore::Seed
- Inherits:
-
Object
- Object
- Thecore::Seed
- Defined in:
- lib/thecore_backend_commons.rb
Class Method Summary collapse
Class Method Details
.delete_setting(ns, setting) ⇒ Object
28 29 30 31 |
# File 'lib/thecore_backend_commons.rb', line 28 def self.delete_setting ns, setting puts "Removing setting #{ns}: #{setting}" ThecoreSettings::Setting.where(ns: ns, key: setting).destroy_all end |
.save_setting(ns, setting, value) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/thecore_backend_commons.rb', line 20 def self.save_setting ns, setting, value puts "Saving setting if nil #{ns}: #{setting} = #{value}" if Settings.ns(ns)[setting].blank? Settings.ns(ns)[setting] if value.blank? Settings.ns(ns)[setting] = value unless value.blank? end end |