Commit 69d34d44 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'pl-rubocop-todo-redundant-self-assignment' into 'master'

Resolves rubocop offense Style/RedundantSelfAssignment

See merge request gitlab-org/gitlab!57920
parents 369e0214 26f9ebb4
...@@ -927,13 +927,6 @@ Style/RedundantRegexpEscape: ...@@ -927,13 +927,6 @@ Style/RedundantRegexpEscape:
Style/RedundantSelf: Style/RedundantSelf:
Enabled: false Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
Style/RedundantSelfAssignment:
Exclude:
- 'app/models/concerns/issuable.rb'
- 'spec/db/schema_spec.rb'
# Offense count: 213 # Offense count: 213
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, AllowInnerSlashes. # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
......
...@@ -324,7 +324,7 @@ module Issuable ...@@ -324,7 +324,7 @@ module Issuable
# This prevents errors when ignored columns are present in the database. # This prevents errors when ignored columns are present in the database.
issuable_columns = with_cte ? issue_grouping_columns(use_cte: with_cte) : "#{table_name}.*" issuable_columns = with_cte ? issue_grouping_columns(use_cte: with_cte) : "#{table_name}.*"
extra_select_columns = extra_select_columns.unshift("(#{highest_priority}) AS highest_priority") extra_select_columns.unshift("(#{highest_priority}) AS highest_priority")
select(issuable_columns) select(issuable_columns)
.select(extra_select_columns) .select(extra_select_columns)
......
---
title: Fixes rubocop offenses Style/RedundantSelfAssignment
merge_request: 57920
author: Shubham Kumar (@imskr)
type: fixed
...@@ -114,7 +114,7 @@ RSpec.describe 'Database schema' do ...@@ -114,7 +114,7 @@ RSpec.describe 'Database schema' do
# postgres and mysql both automatically create an index on the primary # postgres and mysql both automatically create an index on the primary
# key. Also, the rails connection.indexes() method does not return # key. Also, the rails connection.indexes() method does not return
# automatically generated indexes (like the primary key index). # automatically generated indexes (like the primary key index).
first_indexed_column = first_indexed_column.push(primary_key_column) first_indexed_column.push(primary_key_column)
expect(first_indexed_column.uniq).to include(*foreign_keys_columns) expect(first_indexed_column.uniq).to include(*foreign_keys_columns)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment