X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e7087af6bc0d7db9ca3f3c21be76e9c8a9c343b4..945df7f195e23425396f7fb44549ba76f1ef4fd8:/app/models/node.rb diff --git a/app/models/node.rb b/app/models/node.rb index 37143ff00..cc646b768 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -10,6 +10,7 @@ class Node < GeoRecord validates_numericality_of :latitude, :longitude validate :validate_position + has_many :ways, :through => :way_nodes has_many :old_nodes, :foreign_key => :id has_many :way_nodes belongs_to :user @@ -19,14 +20,6 @@ class Node < GeoRecord errors.add_to_base("Node is not in the world") unless in_world? end - # Is this node withing -90 > latitude > 90 and -180 > longitude > 180> - # * returns true/false - def in_world? - return false if self.lat < -90 or self.lat > 90 - return false if self.lon < -180 or self.lon > 180 - return true - end - # # Search for nodes matching tags within bounding_box #