Add validation of string site settings with regex, and min and max lengths

This commit is contained in:
Neil Lalonde
2014-06-18 10:49:21 -04:00
parent 6e94f55f61
commit 3eb65885d1
8 changed files with 167 additions and 24 deletions

View File

@@ -10,7 +10,7 @@ class IntegerSettingValidator
true
end
def error_message(val)
def error_message
if @opts[:min] && @opts[:max]
I18n.t('site_settings.errors.invalid_integer_min_max', {min: @opts[:min], max: @opts[:max]})
elsif @opts[:min]