Code cleanup.
This commit is contained in:
parent
1030eb1840
commit
ac60b151ea
1 changed files with 3 additions and 3 deletions
|
@ -31,7 +31,7 @@ set config setting
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def self.set(name, value)
|
def self.set(name, value)
|
||||||
setting = Setting.find_by( name: name )
|
setting = Setting.find_by(name: name)
|
||||||
if !setting
|
if !setting
|
||||||
raise "Can't find config setting '#{name}'"
|
raise "Can't find config setting '#{name}'"
|
||||||
end
|
end
|
||||||
|
@ -66,7 +66,7 @@ reset config setting to default
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def self.reset(name)
|
def self.reset(name)
|
||||||
setting = Setting.find_by( name: name )
|
setting = Setting.find_by(name: name)
|
||||||
if !setting
|
if !setting
|
||||||
raise "Can't find config setting '#{name}'"
|
raise "Can't find config setting '#{name}'"
|
||||||
end
|
end
|
||||||
|
@ -109,7 +109,7 @@ reload config settings
|
||||||
config.each { |key, value|
|
config.each { |key, value|
|
||||||
next if value.class.to_s != 'String'
|
next if value.class.to_s != 'String'
|
||||||
|
|
||||||
config[key].gsub!( /\#\{config\.(.+?)\}/ ) {
|
config[key].gsub!(/\#\{config\.(.+?)\}/) {
|
||||||
config[$1].to_s
|
config[$1].to_s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue