]> git.openstreetmap.org Git - rails.git/blob - app/controllers/old_relation_controller.rb
Revert Potlatch 0.10 from the trunk - we will keep it on the potlatch_010
[rails.git] / app / controllers / old_relation_controller.rb
1 class OldRelationController < ApplicationController
2   require 'xml/libxml'
3
4   session :off
5   after_filter :compress_output
6
7   def history
8     begin
9       relation = Relation.find(params[:id])
10       doc = OSM::API.new.get_xml_doc
11
12       relation.old_relations.each do |old_relation|
13         doc.root << old_relation.to_xml_node
14       end
15
16       render :text => doc.to_s, :content_type => "text/xml"
17     rescue ActiveRecord::RecordNotFound
18       render :nothing => true, :status => :not_found
19     rescue
20       render :nothing => true, :status => :internal_server_error
21     end
22   end
23 end