rails API support for history of node/segment/way + various bugfixes and cleanups

This commit is contained in:
Steve Coast 2006-11-30 18:44:40 +00:00
parent 8ef8761fa5
commit e799022131
13 changed files with 145 additions and 69 deletions

View file

@ -6,6 +6,8 @@ class Way < ActiveRecord::Base
has_many :way_segments, :foreign_key => 'id'
has_many :way_tags, :foreign_key => 'id'
has_many :old_ways, :foreign_key => :id
set_table_name 'current_ways'
def self.from_xml(xml, create=false)
@ -16,7 +18,7 @@ class Way < ActiveRecord::Base
way = Way.new
doc.find('//osm/way').each do |pt|
unless create and pt['id'] == '0'
if !create and pt['id'] != '0'
way.id = pt['id'].to_i
end