]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation.rb
Tests for PreconditionFailed error messages.
[rails.git] / app / models / relation.rb
index b66d957b90ae3bdb5827accab6a9ed28f2642f40..7be027559883c1e0f42a8f2b9f7c5a0ee5d49225 100644 (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
         # 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?
 
         # and check that it is OK to use.
         unless element and element.visible? and element.preconditions_ok?