mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
safely extract time values from multiparam array
This commit is contained in:
parent
4f0c81b6f8
commit
728c5ccda5
@ -56,7 +56,8 @@ module ValidatesTimeliness
|
||||
end
|
||||
|
||||
def extract_time_from_multiparameter_attributes(values)
|
||||
values.last(3).map { |s| s.rjust(2, "0") }.join(":")
|
||||
values = values.size > 3 ? values[3..5] : values
|
||||
values.map { |s| s.rjust(2, "0") }.join(":")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user