]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_node.rb
changing the belongs_to and has_many items in the models to reflect the new foriegn...
[rails.git] / app / models / old_node.rb
index 42f55f2d0fbd6db5ef66390e3bd08a192482ceb3..58a514bcd7b213b0081cbec3fab73eca91c0eb7d 100644 (file)
@@ -8,18 +8,12 @@ class OldNode < ActiveRecord::Base
   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?
   end
 
-  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
-
   def self.from_node(node)
     old_node = OldNode.new
     old_node.latitude = node.latitude
@@ -90,7 +84,8 @@ class OldNode < ActiveRecord::Base
 
   def tags=(t)
     @tags = t 
-  end 
+  end
+
   def tags_as_hash 
     hash = {} 
     Tags.split(self.tags) do |k,v|