precondition stuff
This commit is contained in:
parent
374d9ea486
commit
9189093997
4 changed files with 27 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue