]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/way.rb
move relations mapping out of way/node objects, so we don't need horrible expensive...
[rails.git] / app / models / way.rb
index cbbe6ada41f540eca762b22786e6e6aa45da362f..6f12f4304db7fa94106dab5ccbcfea6c2875872b 100644 (file)
@@ -214,7 +214,7 @@ class Way < ActiveRecord::Base
   def create_with_history(user)
     check_create_consistency(self, user)
     unless self.preconditions_ok?
-      raise OSM::APIPreconditionFailedError("Cannot create way: data is invalid.")
+      raise OSM::APIPreconditionFailedError.new("Cannot create way: data is invalid.")
     end
     self.version = 0
     self.visible = true
@@ -224,7 +224,7 @@ class Way < ActiveRecord::Base
   def preconditions_ok?
     return false if self.nds.empty?
     if self.nds.length > APP_CONFIG['max_number_of_way_nodes']
-      raise OSM::APITooManyWayNodesError.new(self.nds.count, APP_CONFIG['max_number_of_way_nodes'])
+      raise OSM::APITooManyWayNodesError.new(self.nds.length, APP_CONFIG['max_number_of_way_nodes'])
     end
     self.nds.each do |n|
       node = Node.find(:first, :conditions => ["id = ?", n])