From 0d1f192c54ab65a4a1c938553e5d87be65a966e8 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 8 Feb 2023 04:36:23 -0500 Subject: Apply Rubocop Performance/BlockGivenWithExplicitBlock (#23441) * Apply Rubocop Performance/BlockGivenWithExplicitBlock * Unprefix used block parameter --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/helpers/application_helper.rb') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4c20f1e14..b2687eddd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -67,7 +67,7 @@ module ApplicationHelper def link_to_login(name = nil, html_options = nil, &block) target = new_user_session_path - html_options = name if block_given? + html_options = name if block if omniauth_only? && Devise.mappings[:user].omniauthable? && User.omniauth_providers.size == 1 target = omniauth_authorize_path(:user, User.omniauth_providers[0]) @@ -75,7 +75,7 @@ module ApplicationHelper html_options[:method] = :post end - if block_given? + if block link_to(target, html_options, &block) else link_to(name, target, html_options) -- cgit