fix custom_error_message hash bug using wrong match data index

This commit is contained in:
Adam Meehan 2009-01-12 12:35:35 +11:00
parent db8dd9ac99
commit 525b3b9941

View File

@ -115,7 +115,7 @@ module ValidatesTimeliness
return @custom_error_messages if defined?(@custom_error_messages)
@custom_error_messages = configuration.inject({}) {|msgs, (k, v)|
if md = /(.*)_message$/.match(k.to_s)
msgs[md[0].to_sym] = v
msgs[md[1].to_sym] = v
end
msgs
}