]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/way.rb
Handle segments which do not exist correctly and indicate that the
[rails.git] / app / models / way.rb
index 9d2239d5ca642f616a65b93a6042ec38555f57fa..09d1dafa0adca5b320aaad2003b63c36b9d85e43 100644 (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