]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/old_controller.rb
Fix rubocop style issues
[rails.git] / app / controllers / old_controller.rb
index 002da675c687fb5cf2df1070da6d19881e78d956..9d7cf2113805213af325357fbc2a5751610f5341 100644 (file)
@@ -53,16 +53,15 @@ class OldController < ApplicationController
 
   def redact
     redaction_id = params['redaction']
-    unless redaction_id.nil?
+    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