Fix DateTimeSelect extension to use integers from param values.

Change extension spec to use string params.
This commit is contained in:
Adam Meehan
2011-09-18 18:01:25 +10:00
parent af9d6cdba4
commit e7b503ae4f
2 changed files with 26 additions and 25 deletions

View File

@@ -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