include GeoRecord
include ConsistencyValidations
include NotRedactable
- include ObjectMetadata
self.table_name = "current_nodes"
class OldNode < ApplicationRecord
include GeoRecord
include ConsistencyValidations
- include ObjectMetadata
self.table_name = "nodes"
self.primary_keys = "node_id", "version"
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!
class OldRelation < ApplicationRecord
include ConsistencyValidations
- include ObjectMetadata
self.table_name = "relations"
self.primary_keys = "relation_id", "version"
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
class OldWay < ApplicationRecord
include ConsistencyValidations
- include ObjectMetadata
self.table_name = "ways"
self.primary_keys = "way_id", "version"
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
include ConsistencyValidations
include NotRedactable
- include ObjectMetadata
self.table_name = "current_relations"
include ConsistencyValidations
include NotRedactable
- include ObjectMetadata
self.table_name = "current_ways"