forked from e621ng/e621ng
avoid reinstantiating CustomConfiguration
This commit is contained in:
parent
2aa7a8aa9c
commit
fe86f40f92
@ -500,13 +500,17 @@ module Danbooru
|
||||
end
|
||||
|
||||
class EnvironmentConfiguration
|
||||
def custom_configuration
|
||||
@custom_configuration ||= CustomConfiguration.new
|
||||
end
|
||||
|
||||
def method_missing(method, *args)
|
||||
var = ENV["DANBOORU_#{method.to_s.upcase}"]
|
||||
|
||||
if var.present?
|
||||
var
|
||||
else
|
||||
CustomConfiguration.new.send(method, *args)
|
||||
custom_configuration.send(method, *args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user