]> git.openstreetmap.org Git - rails.git/commitdiff
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 0f368c3dc009c7fdd0ea47014cdf0a043b2b1ecd..ca46726a46fadcf268f3660deb1cf750559f29e3 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 8087268193d9159932826415b33f9e31a05b131c..a04fab5b9ab36c87a19a442c07b277cc59c56250 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 a3c21cd3d7ac7aefc5414ad952cbb0262d27ceff..345bae2616607dde518f25de11b968ae8c08380e 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 49e1e7a7404af3a6f248e57e650b98f84a3f8f02..0b01daf2964bad39810e284874c9d30a950660bf 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