# TODO: Validation
def save_property_sets(resource_id)
- params[:property_sets].each do |key, value|
+ (params[:property_sets] || []).each do |key, value|
set_keys = drop_trailing_blank_values(value)
Property.with_key_prefix(key + '.').delete_all
def save_properties(resource_id)
@updated_properties = {}
- params[:settings].each do |key, value|
+
+ puts params[:settings]
+ puts params[:settings].keys
+
+
+ (params[:settings] || []).each do |key, value|
+ puts value
if value.kind_of? Array
value = drop_trailing_blank_values(value)
end
value = value.first
end
- text_value = (value.blank? ? nil : value.to_s)
+ value = value.to_s if value
+ text_value = (value.blank? ? nil : value)
prop = by_key(key, resource_id, user_id)
if prop