Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename the I18n keys for associations' restrict_dependent_destroy errors #11416

Merged
merged 1 commit into from Jul 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -15,7 +15,7 @@ def handle_dependency
when :restrict_with_error
unless empty?
record = klass.human_attribute_name(reflection.name).downcase
owner.errors.add(:base, :"restrict_dependent_destroy.many", record: record)
owner.errors.add(:base, :"restrict_dependent_destroy.has_many", record: record)
false
end

Expand Down
Expand Up @@ -12,7 +12,7 @@ def handle_dependency
when :restrict_with_error
if load_target
record = klass.human_attribute_name(reflection.name).downcase
owner.errors.add(:base, :"restrict_dependent_destroy.one", record: record)
owner.errors.add(:base, :"restrict_dependent_destroy.has_one", record: record)
false
end

Expand Down
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/locale/en.yml
Expand Up @@ -15,8 +15,8 @@ en:
messages:
record_invalid: "Validation failed: %{errors}"
restrict_dependent_destroy:
one: "Cannot delete record because a dependent %{record} exists"
many: "Cannot delete record because dependent %{record} exist"
has_one: "Cannot delete record because a dependent %{record} exists"
has_many: "Cannot delete record because dependent %{record} exist"
# Append your own errors here or at the model/attributes scope.

# You can define own errors for models or model attributes.
Expand Down