handled at the controller level.
def to_xml_node
el1 = XML::Node.new 'node'
el1['id'] = self.node_id.to_s
- unless self.redacted? and (@user.nil? or not @user.moderator?)
- self.tags.each do |k,v|
- el2 = XML::Node.new('tag')
- el2['k'] = k.to_s
- el2['v'] = v.to_s
- el1 << el2
- end
- el1['lat'] = self.lat.to_s
- el1['lon'] = self.lon.to_s
+
+ self.tags.each do |k,v|
+ el2 = XML::Node.new('tag')
+ el2['k'] = k.to_s
+ el2['v'] = v.to_s
+ el1 << el2
end
+ el1['lat'] = self.lat.to_s
+ el1['lon'] = self.lon.to_s
el1['changeset'] = self.changeset.id.to_s
if self.changeset.user.data_public?
el1['uid'] = self.changeset.user.id.to_s
end
-
-
el1['visible'] = self.visible.to_s
el1['timestamp'] = self.timestamp.xmlschema
el1['version'] = self.version.to_s
- if self.redacted?
- el1['redacted'] = self.redaction.id.to_s
- end
+
+ el1['redacted'] = self.redaction.id.to_s if self.redacted?
+
return el1
end
el1['version'] = self.version.to_s
el1['changeset'] = self.changeset_id.to_s
- if self.redacted?
- el1['redacted'] = self.redaction.id.to_s
+ el1['redacted'] = self.redaction.id.to_s if self.redacted?
+
+ self.old_members.each do |member|
+ e = XML::Node.new 'member'
+ e['type'] = member.member_type.to_s.downcase
+ 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
- unless self.redacted? and (@user.nil? or not @user.moderator?)
- self.old_members.each do |member|
- e = XML::Node.new 'member'
- e['type'] = member.member_type.to_s.downcase
- 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
- end
+ self.old_tags.each do |tag|
+ e = XML::Node.new 'tag'
+ e['k'] = tag.k
+ e['v'] = tag.v
+ el1 << e
end
return el1
el1['version'] = self.version.to_s
el1['changeset'] = self.changeset.id.to_s
- if self.redacted?
- el1['redacted'] = self.redaction.id.to_s
- end
+ el1['redacted'] = self.redaction.id.to_s if self.redacted?
- unless self.redacted? and (@user.nil? or not @user.moderator?)
- # If a way is redacted and the user isn't a moderator, only show
- # meta-data from this revision, but no real data.
- self.old_nodes.each do |nd| # FIXME need to make sure they come back in the right order
- e = XML::Node.new 'nd'
- e['ref'] = nd.node_id.to_s
- el1 << e
- end
+ self.old_nodes.each do |nd| # FIXME need to make sure they come back in the right order
+ e = XML::Node.new 'nd'
+ e['ref'] = nd.node_id.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
- end
+ self.old_tags.each do |tag|
+ e = XML::Node.new 'tag'
+ e['k'] = tag.k
+ e['v'] = tag.v
+ el1 << e
end
+
return el1
end