X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/d7fd3fb6e571e106b6f9613687e657299104d131..c273b4b1faa6dd3d8aba3d5556605f683326948a:/app/models/relation.rb?ds=sidebyside diff --git a/app/models/relation.rb b/app/models/relation.rb index b66d957b9..7be027559 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -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?