Fix new rubocop warnings
authorTom Hughes <tom@compton.nu>
Thu, 18 Jul 2019 15:43:11 +0000 (16:43 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 18 Jul 2019 15:47:08 +0000 (16:47 +0100)
app/controllers/api/amf_controller.rb
app/controllers/reports_controller.rb
app/controllers/users_controller.rb
lib/potlatch.rb

index 0f368c3..ca46726 100644 (file)
@@ -92,14 +92,14 @@ module Api
             result = putway(renumberednodes, *args)
             result[4] = renumberednodes.reject { |k, _v| orn.key?(k) }
             renumberedways[result[2]] = result[3] if result[0].zero? && result[2] != result[3]
-          when "putrelation" then
+          when "putrelation"
             result = putrelation(renumberednodes, renumberedways, *args)
-          when "deleteway" then
+          when "deleteway"
             result = deleteway(*args)
           when "putpoi" then
             result = putpoi(*args)
             renumberednodes[result[2]] = result[3] if result[0].zero? && result[2] != result[3]
-          when "startchangeset" then
+          when "startchangeset"
             result = startchangeset(*args)
           end
 
index 8087268..a04fab5 100644 (file)
@@ -52,12 +52,15 @@ class ReportsController < ApplicationController
 
   def default_assigned_role
     case issue_params[:reportable_type]
-    when "Note" then "moderator"
-    when "User" then case report_params[:category]
-                     when "vandal" then "moderator"
-                     else "administrator"
-                     end
-    else "administrator"
+    when "Note"
+      "moderator"
+    when "User"
+      case report_params[:category]
+      when "vandal" then "moderator"
+      else "administrator"
+      end
+    else
+      "administrator"
     end
   end
 end
index a3c21cd..345bae2 100644 (file)
@@ -520,11 +520,11 @@ class UsersController < ApplicationController
 
       if user
         case user.status
-        when "pending" then
+        when "pending"
           unconfirmed_login(user)
-        when "active", "confirmed" then
+        when "active", "confirmed"
           successful_login(user, request.env["omniauth.params"]["referer"])
-        when "suspended" then
+        when "suspended"
           failed_login t("users.login.account is suspended", :webmaster => "mailto:#{Settings.support_email}").html_safe
         else
           failed_login t("users.login.auth failure")
index 49e1e7a..0b01daf 100644 (file)
@@ -24,7 +24,7 @@ module Potlatch
 
     # Return eight-byte double-precision float
     def self.getdouble(s)
-      a = s.read(8).unpack("G")        # G big-endian, E little-endian
+      a = s.read(8).unpack("G") # G big-endian, E little-endian
       a[0]
     end