From 525b3b9941119e0087cc41a0eefad7d75f8a0cf1 Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Mon, 12 Jan 2009 12:35:35 +1100 Subject: [PATCH] fix custom_error_message hash bug using wrong match data index --- lib/validates_timeliness/validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/validates_timeliness/validator.rb b/lib/validates_timeliness/validator.rb index 0ae431d..1e66d8d 100644 --- a/lib/validates_timeliness/validator.rb +++ b/lib/validates_timeliness/validator.rb @@ -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 }