mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 15:22:58 +00:00
Fix DateTimeSelect extension to use integers from param values.
Change extension spec to use string params.
This commit is contained in:
@@ -10,6 +10,7 @@ module ValidatesTimeliness
|
||||
|
||||
included do
|
||||
alias_method_chain :datetime_selector, :timeliness
|
||||
alias_method_chain :value, :timeliness
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
@@ -55,7 +56,7 @@ module ValidatesTimeliness
|
||||
|
||||
values = [nil] * 6
|
||||
pairs.map do |(param, value)|
|
||||
position = param.scan(/\(([0-9]*).*\)/).first.first
|
||||
position = param.scan(/\((\d+)\w+\)/).first.first
|
||||
values[position.to_i-1] = value.to_i
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user