]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/relation_controller.rb
Migration to add close-time to changesets. This replaces the boolean 'open' attribute...
[rails.git] / app / controllers / relation_controller.rb
index 7ce58dae60d6c63dbf3ac4df128e2c567e31492b..cdd1d34d6fb459434bab7b381286634ebf1d1291 100644 (file)
@@ -180,12 +180,12 @@ class RelationController < ApplicationController
   end
 
   def relations_for_object(objtype)
   end
 
   def relations_for_object(objtype)
-    relationids = RelationMember.find(:all, :conditions => ['member_type=? and member_id=?', objtype, params[:id]]).collect { |ws| ws.id }.uniq
+    relationids = RelationMember.find(:all, :conditions => ['member_type=? and member_id=?', objtype, params[:id]]).collect { |ws| ws.id[0] }.uniq
 
     doc = OSM::API.new.get_xml_doc
 
     Relation.find(relationids).each do |relation|
 
     doc = OSM::API.new.get_xml_doc
 
     Relation.find(relationids).each do |relation|
-      doc.root << relation.to_xml_node
+      doc.root << relation.to_xml_node if relation.visible
     end
 
     render :text => doc.to_s, :content_type => "text/xml"
     end
 
     render :text => doc.to_s, :content_type => "text/xml"