Cache settings
This commit is contained in:
parent
37fb3b4e0b
commit
e4603d2dbd
1 changed files with 7 additions and 1 deletions
|
@ -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.
|
||||
|
|
Reference in a new issue