]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/node.rb
Merge 7922:8377 from trunk.
[rails.git] / app / models / node.rb
index cc646b768c1aeb82fd6ce62c0f26724ed5f6a55b..4393f252679e12cf7a6c606ecd1331ad938228a2 100644 (file)
@@ -10,11 +10,16 @@ class Node < GeoRecord
   validates_numericality_of :latitude, :longitude
   validate :validate_position
 
-  has_many :ways, :through => :way_nodes
+  belongs_to :user
+
   has_many :old_nodes, :foreign_key => :id
+
   has_many :way_nodes
-  belongs_to :user
+  has_many :ways, :through => :way_nodes
+
+  has_many :containing_relation_members, :as => :member
+  has_many :containing_relations, :through => :containing_relation_members
+
   # 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?