Skip to content

Commit 5c03aff

Browse files
committed
Add record class to error message
1 parent 396b22d commit 5c03aff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

activerecord/lib/active_record/persistence.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ def verify_readonly_attribute(name)
10761076

10771077
def _raise_record_not_destroyed
10781078
@_association_destroy_exception ||= nil
1079-
raise @_association_destroy_exception || RecordNotDestroyed.new("Failed to destroy the record", self)
1079+
raise @_association_destroy_exception || RecordNotDestroyed.new("Failed to destroy the #{self.class} record", self)
10801080
ensure
10811081
@_association_destroy_exception = nil
10821082
end

activerecord/test/cases/associations/has_many_associations_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2793,7 +2793,7 @@ def test_association_with_rewhere_doesnt_set_inverse_instance_key
27932793
end
27942794

27952795
assert_equal [original_child], car.reload.failed_bulbs
2796-
assert_equal "Failed to destroy the record", error.message
2796+
assert_equal "Failed to destroy the FailedBulb record", error.message
27972797
end
27982798

27992799
test "updates counter cache when default scope is given" do

0 commit comments

Comments
 (0)