From 3b751f79b87699b7943e74ef1fcea1e8fdb3129f Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 27 Jul 2007 08:16:12 +0000 Subject: [PATCH 1/1] Handle segments which do not exist correctly and indicate that the preconditions for the way are not met. --- app/models/way.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/way.rb b/app/models/way.rb index 9d2239d5c..09d1dafa0 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -189,7 +189,7 @@ class Way < ActiveRecord::Base def preconditions_ok? return false if self.segs.empty? self.segs.each do |n| - segment = Segment.find(n) + segment = Segment.find(:first, :conditions => ["id = ?", n]) unless segment and segment.visible and segment.preconditions_ok? return false end -- 2.39.5