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:
|
Style/CollectionMethods:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/HashConversion:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/HashSyntax:
|
Style/HashSyntax:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user