Permalink
Browse files

use :default for human_attribute_name

  • Loading branch information...
1 parent 8f74ba9 commit e1a7f83fca862fd7472ef6b80f8b6a8d33849a8e Sven Fuchs committed Jul 4, 2008
@@ -168,7 +168,7 @@ def full_messages(options = {})
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
@@ -79,7 +79,7 @@ def test_errors_add_on_blank_generates_message_with_custom_default_message
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

0 comments on commit e1a7f83

Please sign in to comment.