mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
removed usless whitespace check in non-strict regexp match
This commit is contained in:
parent
4e8007bc65
commit
539f823b8b
@ -208,7 +208,7 @@ module ValidatesTimeliness
|
|||||||
expressions = self.send("#{type}_expressions")
|
expressions = self.send("#{type}_expressions")
|
||||||
time_array = nil
|
time_array = nil
|
||||||
expressions.each do |(regexp, processor)|
|
expressions.each do |(regexp, processor)|
|
||||||
regexp = strict || type == :datetime ? /\A#{regexp}\Z/ : (type == :date ? /\A#{regexp}\s?/ : /\s?#{regexp}\Z/)
|
regexp = strict || type == :datetime ? /\A#{regexp}\Z/ : (type == :date ? /\A#{regexp}/ : /#{regexp}\Z/)
|
||||||
if matches = regexp.match(time_string.strip)
|
if matches = regexp.match(time_string.strip)
|
||||||
time_array = processor.call(*matches[1..7])
|
time_array = processor.call(*matches[1..7])
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user