Remove unused to_xml and to_xml_node methods from models
This commit is contained in:
parent
d07ce46929
commit
baea8dc10e
6 changed files with 0 additions and 70 deletions
|
@ -27,7 +27,6 @@ class Node < ApplicationRecord
|
|||
include GeoRecord
|
||||
include ConsistencyValidations
|
||||
include NotRedactable
|
||||
include ObjectMetadata
|
||||
|
||||
self.table_name = "current_nodes"
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
class OldNode < ApplicationRecord
|
||||
include GeoRecord
|
||||
include ConsistencyValidations
|
||||
include ObjectMetadata
|
||||
|
||||
self.table_name = "nodes"
|
||||
self.primary_keys = "node_id", "version"
|
||||
|
@ -69,28 +68,6 @@ class OldNode < ApplicationRecord
|
|||
old_node
|
||||
end
|
||||
|
||||
def to_xml
|
||||
doc = OSM::API.new.get_xml_doc
|
||||
doc.root << to_xml_node
|
||||
doc
|
||||
end
|
||||
|
||||
def to_xml_node(changeset_cache = {}, user_display_name_cache = {})
|
||||
el = XML::Node.new "node"
|
||||
el["id"] = node_id.to_s
|
||||
|
||||
add_metadata_to_xml_node(el, self, changeset_cache, user_display_name_cache)
|
||||
|
||||
if visible?
|
||||
el["lat"] = lat.to_s
|
||||
el["lon"] = lon.to_s
|
||||
end
|
||||
|
||||
add_tags_to_xml_node(el, old_tags)
|
||||
|
||||
el
|
||||
end
|
||||
|
||||
def save_with_dependencies!
|
||||
save!
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
class OldRelation < ApplicationRecord
|
||||
include ConsistencyValidations
|
||||
include ObjectMetadata
|
||||
|
||||
self.table_name = "relations"
|
||||
self.primary_keys = "relation_id", "version"
|
||||
|
@ -88,31 +87,6 @@ class OldRelation < ApplicationRecord
|
|||
|
||||
attr_writer :members, :tags
|
||||
|
||||
def to_xml
|
||||
doc = OSM::API.new.get_xml_doc
|
||||
doc.root << to_xml_node
|
||||
doc
|
||||
end
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
add_tags_to_xml_node(el, old_tags)
|
||||
|
||||
el
|
||||
end
|
||||
|
||||
# Temporary method to match interface to relations
|
||||
def relation_members
|
||||
old_members
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
class OldWay < ApplicationRecord
|
||||
include ConsistencyValidations
|
||||
include ObjectMetadata
|
||||
|
||||
self.table_name = "ways"
|
||||
self.primary_keys = "way_id", "version"
|
||||
|
@ -86,23 +85,6 @@ class OldWay < ApplicationRecord
|
|||
|
||||
attr_writer :nds, :tags
|
||||
|
||||
def to_xml_node(changeset_cache = {}, user_display_name_cache = {})
|
||||
el = XML::Node.new "way"
|
||||
el["id"] = way_id.to_s
|
||||
|
||||
add_metadata_to_xml_node(el, self, changeset_cache, user_display_name_cache)
|
||||
|
||||
old_nodes.each do |nd| # FIXME: need to make sure they come back in the right order
|
||||
node_el = XML::Node.new "nd"
|
||||
node_el["ref"] = nd.node_id.to_s
|
||||
el << node_el
|
||||
end
|
||||
|
||||
add_tags_to_xml_node(el, old_tags)
|
||||
|
||||
el
|
||||
end
|
||||
|
||||
# Temporary method to match interface to ways
|
||||
def way_nodes
|
||||
old_nodes
|
||||
|
|
|
@ -22,7 +22,6 @@ class Relation < ApplicationRecord
|
|||
|
||||
include ConsistencyValidations
|
||||
include NotRedactable
|
||||
include ObjectMetadata
|
||||
|
||||
self.table_name = "current_relations"
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ class Way < ApplicationRecord
|
|||
|
||||
include ConsistencyValidations
|
||||
include NotRedactable
|
||||
include ObjectMetadata
|
||||
|
||||
self.table_name = "current_ways"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue