- def to_xml_node
- el1 = XML::Node.new 'relation'
- el1['id'] = self.id.to_s
- el1['visible'] = self.visible.to_s
- el1['timestamp'] = self.timestamp.xmlschema
- el1['user'] = self.changeset.user.display_name if self.changeset.user.data_public?
- el1['version'] = self.version.to_s
- el1['changeset'] = self.changeset_id.to_s
-
- self.old_members.each do |member|
- e = XML::Node.new 'member'
- e['type'] = member.member_type.to_s
- e['ref'] = member.member_id.to_s # "id" is considered uncool here as it should be unique in XML
- e['role'] = member.member_role.to_s
- el1 << e
- end
-
- self.old_tags.each do |tag|
- e = XML::Node.new 'tag'
- e['k'] = tag.k
- e['v'] = tag.v
- el1 << e
+ def to_xml_node(changeset_cache = {}, user_display_name_cache = {})
+ el = XML::Node.new "relation"
+ el["id"] = relation_id.to_s
+
+ add_metadata_to_xml_node(el, self, changeset_cache, user_display_name_cache)
+
+ old_members.each do |member|
+ member_el = XML::Node.new "member"
+ member_el["type"] = member.member_type.to_s.downcase
+ member_el["ref"] = member.member_id.to_s # "id" is considered uncool here as it should be unique in XML
+ member_el["role"] = member.member_role.to_s
+ el << member_el