lib/isomorfeus/data/object_accelerator.rb in isomorfeus-data-2.5.1 vs lib/isomorfeus/data/object_accelerator.rb in isomorfeus-data-2.5.2
- old
+ new
@@ -83,10 +83,10 @@
hash
end
def save_object(key, fields, already_saved)
id = get_object_id(key)
- raise "object not created yet" unless id
+ return create_object(key, fields, already_saved) unless id
ft = @object_class.field_types
hash = fields.to_h do |k, v|
[k, serialize_or_save(v, ft[k], already_saved)]
end
@store.update(id, hash.merge!({key: key}))