]> git.openstreetmap.org Git - rails.git/commitdiff
Fix new rubocop warnings
authorTom Hughes <tom@compton.nu>
Tue, 17 Aug 2021 17:17:18 +0000 (18:17 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 17 Aug 2021 17:17:18 +0000 (18:17 +0100)
app/controllers/users_controller.rb
lib/classic_pagination/pagination.rb

index e3d5173a785f8510207194e9c9b5c38a1b166e46..42ac6ac11a15e05145d926611215bdaef3437dc4 100644 (file)
@@ -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
index c59c1a90159fae9990d0fc499ed0437427d1f405..51122863689bde1b2e449f1e5c4169bb548d8309 100644 (file)
@@ -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