Add and apply Style/ArrayIntersect rubocop rule
The `intersect?` method has been added in Ruby 3.1, and it's more readable than `(a & b).any?`.
This commit is contained in:
@@ -627,6 +627,9 @@ Style/AndOr:
|
||||
Style/ArrayCoercion:
|
||||
Enabled: true
|
||||
|
||||
Style/ArrayIntersect:
|
||||
Enabled: true
|
||||
|
||||
Style/BlockDelimiters:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ module TranslatableFormHelper
|
||||
end
|
||||
|
||||
def backend_translations_enabled?
|
||||
(controller.class.module_parents & [Admin, Management, Valuation, SDGManagement]).any?
|
||||
controller.class.module_parents.intersect?([Admin, Management, Valuation, SDGManagement])
|
||||
end
|
||||
|
||||
def highlight_translation_html_class
|
||||
|
||||
@@ -43,6 +43,6 @@ class SDG::ProcessEnabled
|
||||
def relatable?
|
||||
return true if controller_path_name?
|
||||
|
||||
(SDG::Related::RELATABLE_TYPES & [record_or_name.class.name, record_or_name]).any?
|
||||
SDG::Related::RELATABLE_TYPES.intersect?([record_or_name.class.name, record_or_name])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user