]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/old_controller.rb
Merge remote-tracking branch 'upstream/pull/2223'
[rails.git] / app / controllers / api / old_controller.rb
index 39bb35ca9f05757c2ac6d4df4d710c411e685010..862d14716f9b12e34c25e6629ada8d1b7e16b8e2 100644 (file)
@@ -22,22 +22,15 @@ module Api
       # to do that ourselves.
       raise OSM::APINotFoundError if @elements.empty?
 
-      visible_elements = if show_redactions?
-                           @elements
-                         else
-                           @elements.unredacted
-                         end
-
-      @elems = []
-
-      visible_elements.each do |element|
-        @elems << element
-      end
+      # determine visible elements
+      @elems = if show_redactions?
+                 @elements
+               else
+                 @elements.unredacted
+               end
 
       # Render the result
-      respond_to do |format|
-        format.xml
-      end
+      render :formats => [:xml]
     end
 
     def version
@@ -47,12 +40,8 @@ module Api
       else
         response.last_modified = @old_element.timestamp
 
-        @elems = [@old_element]
-
         # Render the result
-        respond_to do |format|
-          format.xml
-        end
+        render :formats => [:xml]
       end
     end