]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/old_nodes_controller.rb
Move browse history template to old elements directory
[rails.git] / app / controllers / old_nodes_controller.rb
index 43c8b6b7572719b1c9a14fbc1afefb2c43a3acd7..288322eea4155e40947ffe7902b9f3c0d593e3e6 100644 (file)
@@ -1,11 +1,15 @@
-class OldNodesController < OldController
-  private
-
-  def lookup_old_element
-    @old_element = OldNode.find([params[:id], params[:version]])
+class OldNodesController < OldElementsController
+  def index
+    @type = "node"
+    @feature = Node.preload(:node_tags, :old_nodes => [:old_tags, { :changeset => [:changeset_tags, :user] }]).find(params[:id])
+  rescue ActiveRecord::RecordNotFound
+    render "browse/not_found", :status => :not_found
   end
 
-  def lookup_old_element_versions
-    @elements = OldNode.where(:node_id => params[:id]).order(:version)
+  def show
+    @type = "node"
+    @feature = OldNode.preload(:old_tags, :changeset => [:changeset_tags, :user]).find([params[:id], params[:version]])
+  rescue ActiveRecord::RecordNotFound
+    render :action => "not_found", :status => :not_found
   end
 end