]> git.openstreetmap.org Git - rails.git/commitdiff
Remove unused to_xml and to_xml_node methods from models
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 15 Sep 2021 15:56:28 +0000 (16:56 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 15 Sep 2021 16:05:50 +0000 (17:05 +0100)
app/models/node.rb
app/models/old_node.rb
app/models/old_relation.rb
app/models/old_way.rb
app/models/relation.rb
app/models/way.rb

index 5e799c8d9374b1562d61035b8b710f81f27a64de..8bfac993b5bd9fdd2d512a4007dfff1304cae2ec 100644 (file)
@@ -27,7 +27,6 @@ class Node < ApplicationRecord
   include GeoRecord
   include ConsistencyValidations
   include NotRedactable
   include GeoRecord
   include ConsistencyValidations
   include NotRedactable
-  include ObjectMetadata
 
   self.table_name = "current_nodes"
 
 
   self.table_name = "current_nodes"
 
index 620cc24d227029091e610bfccb0813bb792c0449..81d8e331fcf5e1fc507e5a19119cfc5773e9ab5f 100644 (file)
@@ -27,7 +27,6 @@
 class OldNode < ApplicationRecord
   include GeoRecord
   include ConsistencyValidations
 class OldNode < ApplicationRecord
   include GeoRecord
   include ConsistencyValidations
-  include ObjectMetadata
 
   self.table_name = "nodes"
   self.primary_keys = "node_id", "version"
 
   self.table_name = "nodes"
   self.primary_keys = "node_id", "version"
@@ -69,28 +68,6 @@ class OldNode < ApplicationRecord
     old_node
   end
 
     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!
 
   def save_with_dependencies!
     save!
 
index 51aeb9c4c533f296eaa5a1eaa7a113cca93b46e9..d0a03ac25b01baf942480f6b6e5f3124d846575c 100644 (file)
@@ -22,7 +22,6 @@
 
 class OldRelation < ApplicationRecord
   include ConsistencyValidations
 
 class OldRelation < ApplicationRecord
   include ConsistencyValidations
-  include ObjectMetadata
 
   self.table_name = "relations"
   self.primary_keys = "relation_id", "version"
 
   self.table_name = "relations"
   self.primary_keys = "relation_id", "version"
@@ -88,31 +87,6 @@ class OldRelation < ApplicationRecord
 
   attr_writer :members, :tags
 
 
   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
   # Temporary method to match interface to relations
   def relation_members
     old_members
index 3260f2a1f57acbed3755fe691949d8e14fa1fbbc..9acf8665d2a5fa144c927b9da2763874599f1a95 100644 (file)
@@ -22,7 +22,6 @@
 
 class OldWay < ApplicationRecord
   include ConsistencyValidations
 
 class OldWay < ApplicationRecord
   include ConsistencyValidations
-  include ObjectMetadata
 
   self.table_name = "ways"
   self.primary_keys = "way_id", "version"
 
   self.table_name = "ways"
   self.primary_keys = "way_id", "version"
@@ -86,23 +85,6 @@ class OldWay < ApplicationRecord
 
   attr_writer :nds, :tags
 
 
   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
   # Temporary method to match interface to ways
   def way_nodes
     old_nodes
index 365ea533e11259aa3f9ae9ebc495cb990b400c10..25564940bdd1a4013cf2ae3a533b3fdf2afc4bde 100644 (file)
@@ -22,7 +22,6 @@ class Relation < ApplicationRecord
 
   include ConsistencyValidations
   include NotRedactable
 
   include ConsistencyValidations
   include NotRedactable
-  include ObjectMetadata
 
   self.table_name = "current_relations"
 
 
   self.table_name = "current_relations"
 
index 7bb82b281bc4e10603ea2ffc29eee928c4ff9709..724965ddfe4bc1a24b4de482bf6529ca131eeb90 100644 (file)
@@ -22,7 +22,6 @@ class Way < ApplicationRecord
 
   include ConsistencyValidations
   include NotRedactable
 
   include ConsistencyValidations
   include NotRedactable
-  include ObjectMetadata
 
   self.table_name = "current_ways"
 
 
   self.table_name = "current_ways"