belongs_to :user
has_many :changeset_tags, :foreign_key => 'id'
+
+ has_many :nodes
+ has_many :ways
+ has_many :relations
+ has_many :old_nodes
+ has_many :old_ways
+ has_many :old_relations
def self.from_xml(xml, create=false)
begin
validates_numericality_of :latitude, :longitude
validate :validate_position
- belongs_to :user
+ belongs_to :changeset
has_many :old_nodes, :foreign_key => :id
validates_numericality_of :latitude, :longitude
validate :validate_position
- belongs_to :user
+ belongs_to :changeset
def validate_position
errors.add_to_base("Node is not in the world") unless in_world?
class OldRelation < ActiveRecord::Base
set_table_name 'relations'
- belongs_to :user
+ belongs_to :changeset
def self.from_relation(relation)
old_relation = OldRelation.new
class OldWay < ActiveRecord::Base
set_table_name 'ways'
- belongs_to :user
+ belongs_to :changeset
def self.from_way(way)
old_way = OldWay.new
set_table_name 'current_relations'
- belongs_to :user
+ belongs_to :changeset
has_many :old_relations, :foreign_key => 'id', :order => 'version'
set_table_name 'current_ways'
- belongs_to :user
+ belongs_to :changeset
has_many :old_ways, :foreign_key => 'id', :order => 'version'