<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -87,6 +87,8 @@ module ActiveRecord
     # &lt;/ol&gt;
     def generate_message(attribute, message = :invalid, options = {})
 
+      message, options[:default] = options[:default], message if options[:default].is_a?(Symbol)
+
       defaults = @base.class.self_and_descendents_from_active_record.map do |klass| 
         [ :&quot;models.#{klass.name.underscore}.attributes.#{attribute}.#{message}&quot;, 
           :&quot;models.#{klass.name.underscore}.#{message}&quot; ]
@@ -95,7 +97,6 @@ module ActiveRecord
       defaults &lt;&lt; options.delete(:default)
       defaults = defaults.compact.flatten &lt;&lt; :&quot;messages.#{message}&quot;
 
-      model_name = @base.class.name
       key = defaults.shift
       value = @base.respond_to?(attribute) ? @base.send(attribute) : nil
 </diff>
      <filename>activerecord/lib/active_record/validations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -675,6 +675,38 @@ class ActiveRecordValidationsI18nTests &lt; Test::Unit::TestCase
     replied_topic.valid?
     assert_equal 'global message', replied_topic.errors.on(:replies)
   end
+
+  def test_validations_with_message_symbol_must_translate
+    I18n.backend.store_translations 'en-US', :activerecord =&gt; {:errors =&gt; {:messages =&gt; {:custom_error =&gt; &quot;I am a custom error&quot;}}}
+    Topic.validates_presence_of :title, :message =&gt; :custom_error
+    @topic.title = nil
+    @topic.valid?
+    assert_equal &quot;I am a custom error&quot;, @topic.errors.on(:title)
+  end
+
+  def test_validates_with_message_symbol_must_translate_per_attribute
+    I18n.backend.store_translations 'en-US', :activerecord =&gt; {:errors =&gt; {:models =&gt; {:topic =&gt; {:attributes =&gt; {:title =&gt; {:custom_error =&gt; &quot;I am a custom error&quot;}}}}}}
+    Topic.validates_presence_of :title, :message =&gt; :custom_error
+    @topic.title = nil
+    @topic.valid?
+    assert_equal &quot;I am a custom error&quot;, @topic.errors.on(:title)
+  end
+
+  def test_validates_with_message_symbol_must_translate_per_model
+    I18n.backend.store_translations 'en-US', :activerecord =&gt; {:errors =&gt; {:models =&gt; {:topic =&gt; {:custom_error =&gt; &quot;I am a custom error&quot;}}}}
+    Topic.validates_presence_of :title, :message =&gt; :custom_error
+    @topic.title = nil
+    @topic.valid?
+    assert_equal &quot;I am a custom error&quot;, @topic.errors.on(:title)
+  end
+
+  def test_validates_with_message_string
+    Topic.validates_presence_of :title, :message =&gt; &quot;I am a custom error&quot;
+    @topic.title = nil
+    @topic.valid?
+    assert_equal &quot;I am a custom error&quot;, @topic.errors.on(:title)
+  end
+
 end
 
 class ActiveRecordValidationsGenerateMessageI18nTests &lt; Test::Unit::TestCase
@@ -855,4 +887,5 @@ class ActiveRecordValidationsGenerateMessageI18nTests &lt; Test::Unit::TestCase
   def test_generate_message_even_with_default_message
     assert_equal &quot;must be even&quot;, @topic.errors.generate_message(:title, :even, :default =&gt; nil, :value =&gt; 'title', :count =&gt; 10)
   end
+
 end</diff>
      <filename>activerecord/test/cases/validations_i18n_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a1eb4e11c2cccb91483fa15f1a1a0b2ae518d2cf</id>
    </parent>
  </parents>
  <author>
    <name>Iain Hecker</name>
    <email>github@iain.nl</email>
  </author>
  <url>http://github.com/rails/rails/commit/76797b443929005f43512a147e97f02f3145ed81</url>
  <id>76797b443929005f43512a147e97f02f3145ed81</id>
  <committed-date>2008-08-31T13:24:08-07:00</committed-date>
  <authored-date>2008-08-31T03:14:24-07:00</authored-date>
  <message>translates when a message symbol has been set on builtin validations

Signed-off-by: Jeremy Kemper &lt;jeremy@bitsweat.net&gt;</message>
  <tree>43b6b5ed600a1d547dc939529d3a575fd5109c3c</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
