diff options
author | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-07-04 22:22:20 +0200 |
---|---|---|
committer | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-07-04 22:22:20 +0200 |
commit | e1a7f83fca862fd7472ef6b80f8b6a8d33849a8e (patch) | |
tree | 1455f973b55eda3591b56367e870c12a5ae7378e /activerecord | |
parent | 8f74ba96c47e77e18ce363c8e7cd2fc9196faf7a (diff) | |
download | rails-e1a7f83fca862fd7472ef6b80f8b6a8d33849a8e.tar.gz rails-e1a7f83fca862fd7472ef6b80f8b6a8d33849a8e.tar.bz2 rails-e1a7f83fca862fd7472ef6b80f8b6a8d33849a8e.zip |
use :default for human_attribute_name
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/validations_i18n_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 5245f65869..8ba09b3992 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -168,7 +168,7 @@ module ActiveRecord full_messages << message else key = :"active_record.human_attribute_names.#{@base.class.name.underscore.to_sym}.#{attr}" - attr_name = I18n.translate(key, locale, :raise => true) rescue @base.class.human_attribute_name(attr) + attr_name = I18n.translate(key, locale, :default => @base.class.human_attribute_name(attr)) full_messages << attr_name + " " + message end end diff --git a/activerecord/test/cases/validations_i18n_test.rb b/activerecord/test/cases/validations_i18n_test.rb index 840fcd81d0..5be518c547 100644 --- a/activerecord/test/cases/validations_i18n_test.rb +++ b/activerecord/test/cases/validations_i18n_test.rb @@ -79,7 +79,7 @@ class ActiveRecordValidationsI18nTests < Test::Unit::TestCase def test_errors_full_messages_translates_human_attribute_name_for_model_attributes @topic.errors.instance_variable_set :@errors, { 'title' => 'empty' } - I18n.expects(:translate).with(:"active_record.human_attribute_names.topic.title", 'en-US', :raise => true).returns('Title') + I18n.expects(:translate).with(:"active_record.human_attribute_names.topic.title", 'en-US', :default => 'Title').returns('Title') @topic.errors.full_messages :locale => 'en-US' end end |