Fix `Performance/DeletePrefix` cop (#27448)

local^2
Matt Jankowski 7 months ago committed by GitHub
parent 091a21e1bc
commit 63a2a4b074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      .rubocop_todo.yml
  2. 2
      app/models/featured_tag.rb

@ -100,12 +100,6 @@ Naming/VariableNumber:
- 'spec/models/domain_block_spec.rb'
- 'spec/models/user_spec.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SafeMultiline.
Performance/DeletePrefix:
Exclude:
- 'app/models/featured_tag.rb'
Performance/MapMethodChain:
Exclude:
- 'app/models/feed.rb'

@ -51,7 +51,7 @@ class FeaturedTag < ApplicationRecord
private
def strip_name
self.name = name&.strip&.gsub(/\A#/, '')
self.name = name&.strip&.delete_prefix('#')
end
def set_tag

Loading…
Cancel
Save