提交 5341b849 编写于 作者: R Rafael Mendonça França

Merge pull request #7995 from adimichele/master

Small change to active_record/locale/en.yml
......@@ -4,11 +4,15 @@ en:
#created_at: "Created at"
#updated_at: "Updated at"
# Default error messages
errors:
messages:
taken: "has already been taken"
# Active Record models configuration
activerecord:
errors:
messages:
taken: "has already been taken"
record_invalid: "Validation failed: %{errors}"
restrict_dependent_destroy:
one: "Cannot delete record because a dependent %{record} exists"
......
......@@ -54,4 +54,9 @@ def test_generate_message_taken_with_custom_message
end
end
test "translation for 'taken' can be overridden" do
I18n.backend.store_translations "en", {errors: {attributes: {title: {taken: "Custom taken message" }}}}
assert_equal "Custom taken message", @topic.errors.generate_message(:title, :taken, :value => 'title')
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册