X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/ef7f3d800cbdd49b692df10d312e5fd880e2e938..dc2a2c8ebd1a11e4a64555fda22c6859a51defff:/app/controllers/old_controller.rb?ds=sidebyside diff --git a/app/controllers/old_controller.rb b/app/controllers/old_controller.rb index 002da675c..ff86407f5 100644 --- a/app/controllers/old_controller.rb +++ b/app/controllers/old_controller.rb @@ -2,7 +2,7 @@ # into one place. as it turns out, the API methods for historical # nodes, ways and relations are basically identical. class OldController < ApplicationController - require 'xml/libxml' + require "xml/libxml" skip_before_filter :verify_authenticity_token before_filter :setup_user_auth, :only => [:history, :version] @@ -52,17 +52,16 @@ class OldController < ApplicationController end def redact - redaction_id = params['redaction'] - unless redaction_id.nil? + 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) - - else - # if no redaction ID was provided, then this is an unredact - # operation. - @old_element.redact!(nil) end # just return an empty 200 OK for success