We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c03aff commit 6f7b96bCopy full SHA for 6f7b96b
activerecord/lib/active_record/persistence.rb
@@ -1076,7 +1076,8 @@ def verify_readonly_attribute(name)
1076
1077
def _raise_record_not_destroyed
1078
@_association_destroy_exception ||= nil
1079
- raise @_association_destroy_exception || RecordNotDestroyed.new("Failed to destroy the #{self.class} record", self)
+ key = self.class.primary_key
1080
+ raise @_association_destroy_exception || RecordNotDestroyed.new("Failed to destroy #{self.class} with #{key}=#{send(key)}", self)
1081
ensure
1082
@_association_destroy_exception = nil
1083
end
0 commit comments