Handle segments which do not exist correctly and indicate that the

preconditions for the way are not met.
This commit is contained in:
Tom Hughes 2007-07-27 08:16:12 +00:00
parent efc4c6f85d
commit 3b751f79b8

View file

@ -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