X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e4df9a821900b7a64610e85e42af44bba9e79529..fb17928db19ed0b1e32e5da9d94d6c415d505a1a:/app/controllers/relation_controller.rb diff --git a/app/controllers/relation_controller.rb b/app/controllers/relation_controller.rb index 4f2b12cf5..3f185254b 100644 --- a/app/controllers/relation_controller.rb +++ b/app/controllers/relation_controller.rb @@ -201,16 +201,12 @@ class RelationController < ApplicationController def relations_for_object(objtype) relationids = RelationMember.find(:all, :conditions => ['member_type=? and member_id=?', objtype, params[:id]]).collect { |ws| ws.id }.uniq - if relationids.length > 0 - doc = OSM::API.new.get_xml_doc - - Relation.find(relationids).each do |relation| - doc.root << relation.to_xml_node - end + doc = OSM::API.new.get_xml_doc - render :text => doc.to_s, :content_type => "text/xml" - else - render :nothing => true, :status => :not_found + Relation.find(relationids).each do |relation| + doc.root << relation.to_xml_node end + + render :text => doc.to_s, :content_type => "text/xml" end end