From 700da2b3470de2a7826472160e1c93d8a983fefa Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 7 Jul 2008 16:16:05 +0000 Subject: [PATCH] Tidy up a bit after shaun's merge... --- app/models/node.rb | 10 ++++++++-- app/models/old_node.rb | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/models/node.rb b/app/models/node.rb index 7f9b939db..c8770922d 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -1,5 +1,6 @@ class Node < ActiveRecord::Base require 'xml/libxml' + include GeoRecord set_table_name 'current_nodes' @@ -9,14 +10,19 @@ class Node < ActiveRecord::Base validates_numericality_of :latitude, :longitude validate :validate_position + belongs_to :user + has_many :old_nodes, :foreign_key => :id + has_many :way_nodes + has_many :ways, :through => :way_nodes + has_many :node_tags, :foreign_key => :id - belongs_to :user has_many :containing_relation_members, :class_name => "RelationMember", :as => :member has_many :containing_relations, :class_name => "Relation", :through => :containing_relation_members, :source => :relation, :extend => ObjectFinder - + + # Sanity check the latitude and longitude and add an error if it's broken def validate_position errors.add_to_base("Node is not in the world") unless in_world? end diff --git a/app/models/old_node.rb b/app/models/old_node.rb index 018284528..42f55f2d0 100644 --- a/app/models/old_node.rb +++ b/app/models/old_node.rb @@ -1,5 +1,6 @@ -class OldNode < ActiveRecord::Base - include GeoRecord +class OldNode < ActiveRecord::Base + include GeoRecord + set_table_name 'nodes' validates_presence_of :user_id, :timestamp -- 2.43.2