Arrays have a length method, not a count method.
authorTom Hughes <tom@compton.nu>
Tue, 21 Apr 2009 11:36:41 +0000 (11:36 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 21 Apr 2009 11:36:41 +0000 (11:36 +0000)
app/models/way.rb

index e134d697d63a2b14a5cd61a3c29624c8b00b7714..eb4bf48f428d84c981945447700ab38be15a6529 100644 (file)
@@ -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])