X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/9c01c4cb639775f4f93f477546124247a33f80d2..cf24a5a3ee68905c5f55cf6f17c5d2ea983cb34f:/app/controllers/old_node_controller.rb diff --git a/app/controllers/old_node_controller.rb b/app/controllers/old_node_controller.rb index e27898336..8c43941ec 100644 --- a/app/controllers/old_node_controller.rb +++ b/app/controllers/old_node_controller.rb @@ -22,4 +22,19 @@ class OldNodeController < ApplicationController render :nothing => true, :status => :internal_server_error end end + + def version + begin + old_node = OldNode.find(:first, :conditions => {:id => params[:id], :version => params[:version]} ) + + doc = OSM::API.new.get_xml_doc + doc.root << old_node.to_xml_node + + render :text => doc.to_s, :content_type => "text/xml" + rescue ActiveRecord::RecordNotFound + render :nothing => true, :status => :not_found + rescue + render :nothing => true, :status => :internal_server_error + end + end end