]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/old_elements_controller.rb
Avoid redefining object_id method
[rails.git] / app / controllers / api / old_elements_controller.rb
index 2343252dbb0a63243ece6e1c90c9de0875dfee4c..8e29e245c4245f34ef758fdf22c42ec0dfd44e66 100644 (file)
@@ -3,19 +3,16 @@
 # nodes, ways and relations are basically identical.
 module Api
   class OldElementsController < ApiController
 # nodes, ways and relations are basically identical.
 module Api
   class OldElementsController < ApiController
-    before_action :check_api_writable, :only => [:redact]
-    before_action :setup_user_auth, :only => [:history, :show]
-    before_action :authorize, :only => [:redact]
+    before_action :setup_user_auth
 
     authorize_resource
 
 
     authorize_resource
 
-    around_action :api_call_handle_error, :api_call_timeout
-    before_action :lookup_old_element, :except => [:history]
-    before_action :lookup_old_element_versions, :only => [:history]
+    before_action :lookup_old_element, :except => [:index]
+    before_action :lookup_old_element_versions, :only => [:index]
 
 
-    before_action :set_request_formats, :except => [:redact]
+    before_action :set_request_formats
 
 
-    def history
+    def index
       # the .where() method used in the lookup_old_element_versions
       # call won't throw an error if no records are found, so we have
       # to do that ourselves.
       # the .where() method used in the lookup_old_element_versions
       # call won't throw an error if no records are found, so we have
       # to do that ourselves.
@@ -50,23 +47,6 @@ module Api
       end
     end
 
       end
     end
 
-    def redact
-      redaction_id = params["redaction"]
-      if redaction_id.nil?
-        # if no redaction ID was provided, then this is an unredact
-        # operation.
-        @old_element.redact!(nil)
-      else
-        # if a redaction ID was specified, then set this element to
-        # be redacted in that redaction.
-        redaction = Redaction.find(redaction_id.to_i)
-        @old_element.redact!(redaction)
-      end
-
-      # just return an empty 200 OK for success
-      head :ok
-    end
-
     private
 
     def show_redactions?
     private
 
     def show_redactions?