-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
When performing an update, due to Neo4j's REST API PUT request, the node values are not preserved if not present in the update values. Nothing we can do about that one, but my guess is that keymaker is attempting to insert all the property values of the class but given the code:
def process_attrs(attrs)
attrs = attrs.symbolize_keys
self.class.properties.delete_if{|p| p == :node_id}.each do |property|
if property == :active_record_id
process_attr(property, attrs[:id].present? ? attrs[:id] : attrs[:active_record_id])
else
process_attr(property, attrs[property])
end
end
endit would set the property to nil if not present in the attrs passed (process_attr(property, attrs[property])). Therefore probably a change to the following:
def process_attrs(attrs)
attrs = attrs.symbolize_keys
self.class.properties.delete_if{|p| p == :node_id}.each do |property|
if property == :active_record_id
process_attr(property, attrs[:id].present? ? attrs[:id] : attrs[:active_record_id])
else
if attrs[property]
process_attr(property, attrs[property])
end
end
end
endthis at least inserts current values and replaces current values defined in the passed attrs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels