mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Allow for validates_format_of :without
Prevent erroning with `undefined method `source' for nil:NilClass` when format validation is a "without" one
This commit is contained in:
parent
6cd76c7258
commit
05527de82e
1 changed files with 2 additions and 2 deletions
|
@ -13,8 +13,8 @@ module SimpleForm
|
|||
pattern = options[:pattern]
|
||||
if pattern.is_a?(String)
|
||||
pattern
|
||||
elsif pattern_validator = find_pattern_validator
|
||||
evaluate_format_validator_option(pattern_validator.options[:with]).source
|
||||
elsif (pattern_validator = find_pattern_validator) && (with = pattern_validator.options[:with])
|
||||
evaluate_format_validator_option(with).source
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue