Add and apply Style/CollectionQuerying rubocop rule

This rule was added in rubocop 1.77. We were following it most of the
time. It makes the code more readable in my humble opinion.
This commit is contained in:
Javi Martín
2025-10-31 14:31:35 +01:00
parent 1fa3cf8ce7
commit 7f749bb9bb
9 changed files with 14 additions and 11 deletions

View File

@@ -84,7 +84,7 @@ module Globalizable
length: options[:length],
if: lambda { |translation| translation.locale == Setting.default_locale }
end
if options.count > 1
if options.many?
translation_class.instance_eval do
validates method, options.reject { |key| key == :length }
end