File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1076,7 +1076,8 @@ def verify_readonly_attribute(name)
1076
1076
1077
1077
def _raise_record_not_destroyed
1078
1078
@_association_destroy_exception ||= nil
1079
- raise @_association_destroy_exception || RecordNotDestroyed . new ( "Failed to destroy the record" , self )
1079
+ key = self . class . primary_key
1080
+ raise @_association_destroy_exception || RecordNotDestroyed . new ( "Failed to destroy #{ self . class } with #{ key } =#{ send ( key ) } " , self )
1080
1081
ensure
1081
1082
@_association_destroy_exception = nil
1082
1083
end
Original file line number Diff line number Diff line change @@ -2793,7 +2793,7 @@ def test_association_with_rewhere_doesnt_set_inverse_instance_key
2793
2793
end
2794
2794
2795
2795
assert_equal [ original_child ] , car . reload . failed_bulbs
2796
- assert_equal "Failed to destroy the record " , error . message
2796
+ assert_equal "Failed to destroy FailedBulb with #{ FailedBulb . primary_key } = #{ original_child . id } " , error . message
2797
2797
end
2798
2798
2799
2799
test "updates counter cache when default scope is given" do
You can’t perform that action at this time.
0 commit comments