Remove intermediary arrays when creating hash maps from results (#9291)
This commit is contained in:
parent
367ad21995
commit
8069fd636b
11 changed files with 20 additions and 20 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue