settings_validation_wrapper.rb revision ff244a7b5fbdcaa178a72a07c9f707c2862f492b
end
end
end
"must have value of one of the classes: #{options[:in]}"
end
end
end
end
end
end
end
'all elements must be absolute filepaths'
end
end
end
'all elements must not be blank'
end
end
end
'all elements must be email addresses'
end
end
end
end
"all elements must have those keys: #{options[:keys]}"
end
end
end
unless value.match(/@/)
record.errors.add attribute, 'must be an email address'
end
end
end
FIXNUM = %i(yml__workers__hets
ARRAY = %i(yml__footer
validates :yml__email, email: true
# We assume that deployment is done on a linux machine that has 'nproc'.
# Counting processors is different on other machines.
numericality: {greater_than: 0,
else
end
BOOLEAN.each do |field|
end
validates field, directory: true, if: :in_production?
end
end
ELEMENT_PRESENT.each { |field| validates field, elements_are_present: true }
elements_are_email: true
end
# We use '__' as a separator. It will be replaced by a dot.
# This uses the fact that our settings-keys never have two consecutive
# underscores.
# yml__git__verify_url maps to Settings.git.verify_url.
# initializers__git__verify_url maps to @config.git.verify_url.
if object == :error || key_chain.blank?
end
end
case first_portion
when 'yml'
when 'initializers'
else
end
end
key_chain.each do |key|
if object.respond_to?(key)
object = object.send(key)
else
# The nil value shall be caught by the presence validators.
return nil
end
end
end
end