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:
@@ -469,6 +469,9 @@ Style/ClassVars:
|
||||
Style/CollectionMethods:
|
||||
Enabled: true
|
||||
|
||||
Style/HashConversion:
|
||||
Enabled: true
|
||||
|
||||
Style/HashSyntax:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ module SettingsHelper
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
def display_setting_name(setting_name)
|
||||
|
||||
Reference in New Issue
Block a user