]> git.openstreetmap.org Git - rails.git/blob - app/controllers/old_node_controller.rb
Use BETWEEN for the node selection in the map API call as MySQL seems to
[rails.git] / app / controllers / old_node_controller.rb
1 class OldNodeController < ApplicationController
2   require 'xml/libxml'
3
4   session :off
5   after_filter :compress_output
6
7   def history
8     begin
9       node = Node.find(params[:id])
10
11       doc = OSM::API.new.get_xml_doc
12
13       node.old_nodes.each do |old_node|
14         doc.root << old_node.to_xml_node
15       end
16
17       render :text => doc.to_s, :content_type => "text/xml"
18     rescue ActiveRecord::RecordNotFound
19       render :nothing => true, :status => :not_found
20     rescue
21       render :nothing => true, :status => :internal_server_error
22     end
23   end
24 end