diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-09 23:53:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-09 23:53:54 +0200 |
commit | 7b31b06d4afd73734ac54cbbac105f0eab8d0d43 (patch) | |
tree | 94789c1c7f3c8e1c611a30548cd90ecbb34f98ea /activemodel | |
parent | 67d0c9ee93100dbdcafd20b0632e5bef6735888e (diff) | |
parent | f006de5dc5a709f5dc8604ebd43f7741da30cd9f (diff) | |
download | rails-7b31b06d4afd73734ac54cbbac105f0eab8d0d43.tar.gz rails-7b31b06d4afd73734ac54cbbac105f0eab8d0d43.tar.bz2 rails-7b31b06d4afd73734ac54cbbac105f0eab8d0d43.zip |
Merge pull request #26095 from kamipo/fix_broken_alignment_by_auto_correct
Fix broken alignments caused by auto-correct commit 411ccbd
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 3 | ||||
-rw-r--r-- | activemodel/test/cases/validations/confirmation_validation_test.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index b6ab7ab6b0..45ef14013a 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -439,7 +439,8 @@ module ActiveModel return message if attribute == :base attr_name = attribute.to_s.tr(".", "_").humanize attr_name = @base.class.human_attribute_name(attribute, default: attr_name) - I18n.t(:"errors.format", default: "%{attribute} %{message}", + I18n.t(:"errors.format", + default: "%{attribute} %{message}", attribute: attr_name, message: message) end diff --git a/activemodel/test/cases/validations/confirmation_validation_test.rb b/activemodel/test/cases/validations/confirmation_validation_test.rb index a980628765..c13017d825 100644 --- a/activemodel/test/cases/validations/confirmation_validation_test.rb +++ b/activemodel/test/cases/validations/confirmation_validation_test.rb @@ -55,7 +55,8 @@ class ConfirmationValidationTest < ActiveModel::TestCase @old_load_path, @old_backend = I18n.load_path.dup, I18n.backend I18n.load_path.clear I18n.backend = I18n::Backend::Simple.new - I18n.backend.store_translations("en", errors: { messages: { confirmation: "doesn't match %{attribute}" } }, + I18n.backend.store_translations("en", + errors: { messages: { confirmation: "doesn't match %{attribute}" } }, activemodel: { attributes: { topic: { title: "Test Title"} } }) Topic.validates_confirmation_of(:title) |