]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/way.rb
precondition stuff
[rails.git] / app / models / way.rb
index 43bd4d8c394dae334a1016a9dbb1cc5a9bca4e0b..55a578acdbbd5d42a32476618b76bbd453039b33 100644 (file)
@@ -139,4 +139,14 @@ class Way < ActiveRecord::Base
     old_way.save_with_dependencies
   end
 
+  def preconditions_ok?
+    self.segs.each do |n|
+      segment = Segment.find(n)
+      unless segment and segment.visible and segment.preconditions_ok?
+        return false
+      end
+    end
+    return true
+  end
+
 end