X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fc25c3d412829774abf0454e4dcc92e41f47454c..87e8cf3b5860509c0344cb34ee939ae73ea99c00:/app/models/way.rb diff --git a/app/models/way.rb b/app/models/way.rb index b1870fc89..9bd792ddc 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -2,8 +2,9 @@ class Way < ActiveRecord::Base require 'xml/libxml' include ConsistencyValidations + include NotRedactable - set_table_name 'current_ways' + self.table_name = "current_ways" belongs_to :changeset @@ -64,6 +65,10 @@ class Way < ActiveRecord::Base # and manually set to false before the actual delete. way.visible = true + # Start with no tags + way.tags = Hash.new + + # Add in any tags from the XML pt.find('tag').each do |tag| raise OSM::APIBadXMLError.new("way", pt, "tag is missing key") if tag['k'].nil? raise OSM::APIBadXMLError.new("way", pt, "tag is missing value") if tag['v'].nil? @@ -205,7 +210,7 @@ class Way < ActiveRecord::Base def bbox lons = nodes.collect { |n| n.longitude } lats = nodes.collect { |n| n.latitude } - [ lons.min, lats.min, lons.max, lats.max ] + BoundingBox.new(lons.min, lats.min, lons.max, lats.max) end def update_from(new_way, user)