From d672a14ee766e86c606db566dd073a3d2332cc60 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Wed, 26 Aug 2009 19:22:56 +0200 Subject: allow ActiveRecord#RecordInvalid exception message to be localized [#2754 state:committed] Signed-off-by: Jeremy Kemper --- activerecord/lib/active_record/validations.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/validations.rb') diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index a7fa98756e..5fc41cf054 100644 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -12,7 +12,8 @@ module ActiveRecord attr_reader :record def initialize(record) @record = record - super("Validation failed: #{@record.errors.full_messages.join(", ")}") + errors = @record.errors.full_messages.join(I18n.t('support.array.words_connector', :default => ', ')) + super(I18n.t('activerecord.errors.messages.record_invalid', :errors => errors)) end end -- cgit v1.2.3