Remove intermediary arrays when creating hash maps from results (#9291)

This commit is contained in:
Eugen Rochko
2018-11-16 15:02:18 +01:00
committed by GitHub
parent 367ad21995
commit 8069fd636b
11 changed files with 20 additions and 20 deletions

View File

@ -40,7 +40,7 @@ class Setting < RailsSettings::Base
def all_as_records
vars = thing_scoped
records = vars.map { |r| [r.var, r] }.to_h
records = vars.each_with_object({}) { |r, h| h[r.var] = r }
default_settings.each do |key, default_value|
next if records.key?(key) || default_value.is_a?(Hash)