From 410964bec8d5efe9f03fa4699ce0fab30c0d92e8 Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Sat, 30 Nov 2019 18:01:18 +0900 Subject: [PATCH 1/2] Code cleanup: RuboCop: Fix Performance/RedundantMerge --- .rubocop_todo.yml | 1 - app/helpers/avatars_helper.rb | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9667387e6..92d44e7fd 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -541,7 +541,6 @@ Performance/RedundantMerge: Exclude: - 'app/controllers/issues_controller.rb' - 'app/helpers/application_helper.rb' - - 'app/helpers/avatars_helper.rb' - 'app/helpers/custom_fields_helper.rb' - 'app/helpers/workflows_helper.rb' - 'app/models/auth_source_ldap.rb' diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index 7e2a1fffd..8cf3da970 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -23,14 +23,14 @@ module AvatarsHelper def assignee_avatar(user, options={}) return '' unless user - options.merge!(:title => l(:field_assigned_to) + ": " + user.name) + options[:title] = l(:field_assigned_to) + ': ' + user.name avatar(user, options).to_s.html_safe end def author_avatar(user, options={}) return '' unless user - options.merge!(:title => l(:field_author) + ": " + user.name) + options[:title] = l(:field_author) + ': ' + user.name avatar(user, options).to_s.html_safe end @@ -38,7 +38,7 @@ module AvatarsHelper # +user+ can be a User or a string that will be scanned for an email address (eg. 'joe ') def avatar(user, options = { }) if Setting.gravatar_enabled? - options.merge!(:default => Setting.gravatar_default) + options[:default] = Setting.gravatar_default options[:class] = GravatarHelper::DEFAULT_OPTIONS[:class] + " " + options[:class] if options[:class] email = nil if user.respond_to?(:mail) -- 2.21.0 (Apple Git-122.2)