mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
push strict override for format option into Formats.parse
This commit is contained in:
parent
1b865cc834
commit
162faf632a
@ -179,6 +179,7 @@ module ValidatesTimeliness
|
||||
options.reverse_merge!(:strict => true)
|
||||
|
||||
sets = if options[:format]
|
||||
options[:strict] = true
|
||||
[ send("#{type}_expressions").assoc(options[:format]) ]
|
||||
else
|
||||
expression_set(type, string)
|
||||
|
||||
@ -32,8 +32,7 @@ module ValidatesTimeliness
|
||||
raw_value = raw_value(record, attr_name) || value
|
||||
|
||||
if value.is_a?(String) || configuration[:format]
|
||||
strict = !configuration[:format].nil?
|
||||
value = ValidatesTimeliness::Parser.parse(raw_value, type, :strict => strict, :format => configuration[:format])
|
||||
value = ValidatesTimeliness::Parser.parse(raw_value, type, :strict => false, :format => configuration[:format])
|
||||
end
|
||||
|
||||
return if (raw_value.nil? && configuration[:allow_nil]) || (raw_value.blank? && configuration[:allow_blank])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user