1
0
Fork 0

Cache settings

This commit is contained in:
Alex Kotov 2019-09-02 22:25:32 +05:00
parent 37fb3b4e0b
commit e4603d2dbd
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -33,7 +33,13 @@ module Partynest
].freeze
def settings(name)
config_for("settings/#{name}").deep_symbolize_keys
name = String(name).to_sym
raise "Invalid name: #{name.to_s.inspect}" unless name.match?(/\A\w+\z/)
@partynest_settings ||= {}
@partynest_settings[name] ||=
config_for("settings/#{name}").deep_symbolize_keys.freeze
end
# Initialize configuration defaults for originally generated Rails version.