class

ActiveRecord::RecordNotDestroyed

v7.1.3.2 - Show latest stable - Superclass: ActiveRecord::ActiveRecordError

Raised by {ActiveRecord::Base#destroy!}[rdoc-ref:Persistence#destroy!] when a call to {#destroy}[rdoc-ref:Persistence#destroy] would return false.

begin
  complex_operation_that_internally_calls_destroy!
rescue ActiveRecord::RecordNotDestroyed => invalid
  puts invalid.record.errors
end

Attributes

[R]record

Files

  • activerecord/lib/active_record/errors.rb