FIX: validate presence of 'top menu' setting

This commit is contained in:
Arpit Jalan
2018-01-17 01:37:18 +05:30
parent d74f609921
commit 1208254961
3 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,16 @@
class RegexPresenceValidator
include RegexSettingValidation
def initialize(opts = {})
@opts = opts
initialize_regex_opts(opts)
end
def valid_value?(val)
val.present? && regex_match?(val)
end
def error_message
I18n.t(@regex_error)
end
end