Permalink
Browse files

Merge pull request #7995 from adimichele/master

Small change to active_record/locale/en.yml
  • Loading branch information...
rafaelfranca committed Oct 20, 2012
2 parents c50de96 + f48b7cc commit 5341b84936d93ec90e6252af437a3871101c115a
@@ -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"

This comment has been minimized.

Show comment
Hide comment
@rubys

rubys Oct 21, 2012

Contributor

This change probably should be noted in the release notes.

Meanwhile, I've updated the Agile Web Development with Rails tests:

rubys/awdwr@598865c#L0R425

@rubys

rubys Oct 21, 2012

Contributor

This change probably should be noted in the release notes.

Meanwhile, I've updated the Agile Web Development with Rails tests:

rubys/awdwr@598865c#L0R425

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

0 comments on commit 5341b84

Please sign in to comment.