Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Ruby to version 3.1.4 #5157

Merged
merged 5 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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?`.
  • Loading branch information
javierm committed Sep 12, 2023
commit 584176adfa2a9fa9f39191a33c3b1a9125a18113
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,9 @@ Style/AndOr:
Style/ArrayCoercion:
Enabled: true

Style/ArrayIntersect:
Enabled: true

Style/BlockDelimiters:
Enabled: true

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/translatable_form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def translations_interface_enabled?
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
Expand Down
2 changes: 1 addition & 1 deletion app/models/sdg/process_enabled.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ def module_name
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