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:
|
Style/ArrayCoercion:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/ArrayIntersect:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/BlockDelimiters:
|
Style/BlockDelimiters:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ module TranslatableFormHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def backend_translations_enabled?
|
def backend_translations_enabled?
|
||||||
(controller.class.module_parents & [Admin, Management, Valuation, SDGManagement]).any?
|
controller.class.module_parents.intersect?([Admin, Management, Valuation, SDGManagement])
|
||||||
end
|
end
|
||||||
|
|
||||||
def highlight_translation_html_class
|
def highlight_translation_html_class
|
||||||
|
|||||||
@@ -43,6 +43,6 @@ class SDG::ProcessEnabled
|
|||||||
def relatable?
|
def relatable?
|
||||||
return true if controller_path_name?
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user