From: Tom Hughes Date: Fri, 27 Jul 2007 08:16:12 +0000 (+0000) Subject: Handle segments which do not exist correctly and indicate that the X-Git-Tag: live~8808 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/3b751f79b87699b7943e74ef1fcea1e8fdb3129f?ds=sidebyside;hp=efc4c6f85de12eab4fc5c7c621d73f779570d958 Handle segments which do not exist correctly and indicate that the preconditions for the way are not met. --- 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