Actions
Defect #44243
closedFix RuboCop Style/ArrayIntersect offenses
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
Actions