Arrays have a length method, not a count method.

This commit is contained in:
Tom Hughes 2009-04-21 11:36:41 +00:00
parent 5e10a7d48b
commit ff9f596cea

View 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])