lib/scrivito/attribute_deserializer.rb in scrivito_sdk-1.6.0.rc1 vs lib/scrivito/attribute_deserializer.rb in scrivito_sdk-1.6.0.rc2
- old
+ new
@@ -23,11 +23,11 @@
private
def deserialize_binary_value(attribute_value)
if attribute_value && (id = attribute_value['id'])
- Binary.new(id, workspace.published?)
+ Binary.new(id, workspace.published?, obj_id: obj_id)
end
end
def deserialize_date_value(attribute_value)
DateConversion.deserialize_from_backend(attribute_value) if attribute_value
@@ -119,9 +119,18 @@
def deserialize_widget_value(widget_id, attribute_definition)
model.widget_from_pool(widget_id).tap do |widget|
raise ScrivitoError, "Widget with ID #{widget_id} not found!" unless widget
widget.container = model
widget.container_attribute_name = attribute_definition.name
+ end
+ end
+
+ def obj_id
+ case model
+ when BasicObj
+ model.id
+ when BasicWidget
+ model.obj.id
end
end
end
end