class ActiveRecord::RecordNotDestroyed

Parent:
ActiveRecord::ActiveRecordError

Raised by ActiveRecord::Base#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

Attributes

record[R]

Public Class Methods

new(message = nil, record = nil) Show source
# File activerecord/lib/active_record/errors.rb, line 94
def initialize(message = nil, record = nil)
  @record = record
  super(message)
end
Calls superclass method

© 2004–2019 David Heinemeier Hansson
Licensed under the MIT License.