From: Tom Hughes Date: Tue, 17 Aug 2021 17:17:18 +0000 (+0100) Subject: Fix new rubocop warnings X-Git-Tag: live~1580 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/7d46f5db6004f1e0555150c3f97c82185d76b837?hp=e13f17adf086b66b22dc623f5c77884f1e881da8 Fix new rubocop warnings --- diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e3d5173a7..42ac6ac11 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -277,15 +277,15 @@ class UsersController < ApplicationController name = auth_info[:info][:name] email = auth_info[:info][:email] - case provider - when "openid" - email_verified = uid.match(%r{https://www.google.com/accounts/o8/id?(.*)}) || + email_verified = case provider + when "openid" + uid.match(%r{https://www.google.com/accounts/o8/id?(.*)}) || uid.match(%r{https://me.yahoo.com/(.*)}) - when "google", "facebook" - email_verified = true - else - email_verified = false - end + when "google", "facebook" + true + else + false + end if settings = session.delete(:new_user_settings) current_user.auth_provider = provider diff --git a/lib/classic_pagination/pagination.rb b/lib/classic_pagination/pagination.rb index c59c1a901..511228636 100644 --- a/lib/classic_pagination/pagination.rb +++ b/lib/classic_pagination/pagination.rb @@ -81,12 +81,12 @@ module ActionController }.freeze end - def self.included(base) #:nodoc: + def self.included(base) # :nodoc: super base.extend(ClassMethods) end - def self.validate_options!(collection_id, options, in_action) #:nodoc: + def self.validate_options!(collection_id, options, in_action) # :nodoc: options.merge!(DEFAULT_OPTIONS) { |_key, old, _new| old } valid_options = DEFAULT_OPTIONS.keys @@ -156,7 +156,7 @@ module ActionController protected - def create_paginators_and_retrieve_collections #:nodoc: + def create_paginators_and_retrieve_collections # :nodoc: Pagination::OPTIONS[self.class].each do |collection_id, options| next if options[:actions]&.exclude?(action_name) @@ -204,7 +204,7 @@ module ActionController private - def paginator_and_collection_for(_collection_id, options) #:nodoc: + def paginator_and_collection_for(_collection_id, options) # :nodoc: klass = options[:class_name].constantize page = params[options[:parameter]] count = count_collection_for_pagination(klass, options) @@ -378,7 +378,7 @@ module ActionController [@paginator.items_per_page, offset] end - def to_param #:nodoc: + def to_param # :nodoc: @number.to_s end end