lib/tunable/model.rb in tunable-0.0.4 vs lib/tunable/model.rb in tunable-0.0.5

- old
+ new

@@ -151,9 +151,18 @@ return val if !val.nil? or self.class.default_settings(context)[key.to_sym].nil? self.class.default_settings(context)[key.to_sym] end + def set_setting(context, key, val) + obj = { context => { key => val } } + self.settings = obj + end + + def remove_setting(context, key) + set_setting(context, key, nil) + end + def get_main_setting(key) get_setting(:main, key) end def settings_context(context)