- # assign new contents
- new_relation.members = typedmembers
- new_relation.tags = tags
- new_relation.visible = visible
- new_relation.changeset_id = changeset
- new_relation.version = version
-
-
- if id <= 0
- # We're creating the node
- new_relation.create_with_history(user)
- elsif visible
- # We're updating the node
- relation.update_from(new_relation, user)
- else
- # We're deleting the node
- relation.delete_with_history!(new_relation, user)
- end
+ # assign new contents
+ new_relation.members = typedmembers
+ new_relation.tags = tags
+ new_relation.visible = visible
+ new_relation.changeset_id = changeset_id
+ new_relation.version = version
+
+ # NOTE: id or relid here? id doesn't seem to be set above
+ if relid <= 0
+ # We're creating the node
+ new_relation.create_with_history(user)
+ elsif visible
+ # We're updating the node
+ relation.update_from(new_relation, user)
+ else
+ # We're deleting the node
+ relation.delete_with_history!(new_relation, user)
+ end
+ end # transaction