lib/tunable/model.rb in tunable-0.0.1 vs lib/tunable/model.rb in tunable-0.0.2
- old
+ new
@@ -137,11 +137,10 @@
end # ClassMethods
# instance methods below
def settings=(hash)
- puts hash.inspect
Tunable::Setting.store_many(hash, self)
end
def settings_hash
if modified_settings.any?
@@ -228,10 +227,11 @@
fields.each do |key, value|
# even though we do normalize on the setters, not all settings are
# main settings, so we need to make sure we normalize here again
normalized_value = Tunable.normalize_value(value)
- new_settings << [context.to_s, key.to_s, normalized_value, self.id, self.class.model_name.to_s]
+ # class.base_class returns name of parent class for STI models
+ new_settings << [context.to_s, key.to_s, normalized_value, self.id, self.class.base_class.name]
# remove_instance_variable("@setting_main_#{key}") if context == :main
end
end
Tunable::Setting.import(Tunable::COLUMNS, new_settings, { :method => 'REPLACE' }) # from lib/core_ext