edge badge

Raised by ActiveRecord::Persistence#destroy! when a call to destroy would return false.

begin
  complex_operation_that_internally_calls_destroy!
rescue ActiveRecord::RecordNotDestroyed => invalid
  puts invalid.record.errors
end
Methods
N
Attributes
[R] record
Class Public methods
new(record)
# File activerecord/lib/active_record/errors.rb, line 74
def initialize(record)
  @record = record
  super()
end