Project

General

Profile

Actions

Defect #44243

closed

Fix RuboCop Style/ArrayIntersect offenses

Added by Go MAEDA 1 day ago. Updated 1 day ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Resolution:
Fixed
Affected version:

Description

This patch fixes Style/ArrayIntersect offenses reported by RuboCop 1.88.2. Both trunk and 7.0-stable are affected.

app/models/issue_query.rb:409:12: C: [Correctable] Style/ArrayIntersect: Use ["#{Issue.table_name}.id ASC", "#{Issue.table_name}.id DESC"].intersect?(order_option) instead of ["#{Issue.table_name}.id ASC", "#{Issue.table_name}.id DESC"].any?{|i| order_option.include?(i)}.
    unless ["#{Issue.table_name}.id ASC", "#{Issue.table_name}.id DESC"].any?{|i| order_option.include?(i)}
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/issue_query.rb:460:12: C: [Correctable] Style/ArrayIntersect: Use ["#{Issue.table_name}.id ASC", "#{Issue.table_name}.id DESC"].intersect?(order_option) instead of ["#{Issue.table_name}.id ASC", "#{Issue.table_name}.id DESC"].any?{|i| order_option.include?(i)}.
    unless ["#{Issue.table_name}.id ASC", "#{Issue.table_name}.id DESC"].any?{|i| order_option.include?(i)}
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Files

fix-ArrayIntersect.diff (1.19 KB) fix-ArrayIntersect.diff Go MAEDA, 2026-07-09 05:16
Actions

Also available in: Atom PDF