From 1f880528bd834bd59465b51ea8eccfe9fbd1715a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 18 Jul 2019 16:43:11 +0100 Subject: [PATCH] Fix new rubocop warnings --- app/controllers/api/amf_controller.rb | 6 +++--- app/controllers/reports_controller.rb | 15 +++++++++------ app/controllers/users_controller.rb | 6 +++--- lib/potlatch.rb | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/controllers/api/amf_controller.rb b/app/controllers/api/amf_controller.rb index 0f368c3dc..ca46726a4 100644 --- a/app/controllers/api/amf_controller.rb +++ b/app/controllers/api/amf_controller.rb @@ -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 diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index 808726819..a04fab5b9 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a3c21cd3d..345bae261 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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") diff --git a/lib/potlatch.rb b/lib/potlatch.rb index 49e1e7a74..0b01daf29 100644 --- a/lib/potlatch.rb +++ b/lib/potlatch.rb @@ -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 -- 2.39.5