]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/ways_controller.rb
Merge branch 'master' into patch/view_migration
[rails.git] / app / controllers / api / ways_controller.rb
index b8ce1010f29cc1e3fa046c67b78a1733882892c8..0871384a7289030397ee3eddff3d97d87ccdf297 100644 (file)
@@ -22,13 +22,11 @@ module Api
     end
 
     def show
-      way = Way.find(params[:id])
-
-      response.last_modified = way.timestamp
+      @way = Way.find(params[:id])
 
-      if way.visible
-        @ways = [way]
+      response.last_modified = @way.timestamp
 
+      if @way.visible
         # Render the result
         respond_to do |format|
           format.xml
@@ -64,24 +62,20 @@ module Api
     end
 
     def full
-      way = Way.includes(:nodes => :node_tags).find(params[:id])
+      @way = Way.includes(:nodes => :node_tags).find(params[:id])
 
-      if way.visible
+      if @way.visible
         visible_nodes = {}
-        # changeset_cache = {}
-        # user_display_name_cache = {}
 
         @nodes = []
 
-        way.nodes.uniq.each do |node|
+        @way.nodes.uniq.each do |node|
           if node.visible
             @nodes << node
             visible_nodes[node.id] = node
           end
         end
 
-        @ways = [way]
-
         # Render the result
         respond_to do |format|
           format.xml