Add and apply Style/HashConversion rubocop rule

This rule was added in Rubocop 1.10.0. This style is IMHO clearer and
possible since Ruby 2.1.
This commit is contained in:
Javi Martín
2021-08-11 17:53:34 +02:00
parent 41a9d17c76
commit 2bc6018465
2 changed files with 4 additions and 1 deletions

View File

@@ -469,6 +469,9 @@ Style/ClassVars:
Style/CollectionMethods: Style/CollectionMethods:
Enabled: true Enabled: true
Style/HashConversion:
Enabled: true
Style/HashSyntax: Style/HashSyntax:
Enabled: true Enabled: true

View File

@@ -13,7 +13,7 @@ module SettingsHelper
end end
def setting def setting
@all_settings ||= Hash[Setting.all.map { |s| [s.key, s.value.presence] }] @all_settings ||= Setting.all.map { |s| [s.key, s.value.presence] }.to_h
end end
def display_setting_name(setting_name) def display_setting_name(setting_name)