Add and apply Naming/BlockForwarding rubocop rule
This syntax has been added in Ruby 3.1. Not using a variable name might not be very descriptive, but it's just as descriptive as using "block" as a variable name. Using just `&` we get the same amount of information than using `&block`: that we're passing a block. We're still using `&action` in `around_action` methods because here we aren't using a generic name for the variable, so (at least for now) we aren't running this cop on controllers using `around_action`.
This commit is contained in:
@@ -50,7 +50,7 @@ class RemoteTranslations::Microsoft::AvailableLocales
|
||||
JSON.parse(result)["translation"].map(&:first)
|
||||
end
|
||||
|
||||
def self.daily_cache(key, &block)
|
||||
Rails.cache.fetch("remote_available_locales/#{Time.current.strftime("%Y-%m-%d")}/#{key}", &block)
|
||||
def self.daily_cache(key, &)
|
||||
Rails.cache.fetch("remote_available_locales/#{Time.current.strftime("%Y-%m-%d")}/#{key}", &)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user