Tests for PreconditionFailed error messages.

Change to relation.rb to bring element selection in-line with that of way, so to return nil to be caught later, rather than raise an error.
Change to way.rb to clarify which way on diff upload.
This commit is contained in:
Thomas Wood 2009-05-06 21:08:50 +00:00
parent d7fd3fb6e5
commit c273b4b1fa
6 changed files with 10 additions and 2 deletions

View file

@ -298,7 +298,7 @@ class Relation < ActiveRecord::Base
# use reflection to look up the appropriate class
model = Kernel.const_get(m[0].capitalize)
# get the element with that ID
element = model.find(m[1])
element = model.find(:first, :conditions =>["id = ?", m[1]])
# and check that it is OK to use.
unless element and element.visible? and element.preconditions_ok?