]> git.openstreetmap.org Git - rails.git/commitdiff
Always allow %{attribute} in model validation error messages
authorTom Hughes <tom@compton.nu>
Tue, 6 Aug 2013 20:36:54 +0000 (21:36 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 21 Sep 2013 11:03:53 +0000 (12:03 +0100)
test/unit/i18n_test.rb

index c1dacbff2b63aeb09946387fd17d2f5f5873b5c6..2fb13824ca0904bfecd67964c194003161285331 100644 (file)
@@ -24,6 +24,10 @@ class I18nTest < ActiveSupport::TestCase
           end
         end
 
+        if key =~ /^(active(model|record)\.)?errors\./
+          variables.push("attribute")
+        end
+
         value = I18n.t(key, :locale => locale, :fallback => true)
 
         if value.is_a?(Hash)