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