class ActiveRecord::RecordNotDestroyed - activerecord-4.2.3 Documentation

# class ActiveRecord::RecordNotDestroyed

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

### Attributes

record[R]

### Public Class Methods

new(message, record = nil) click to toggle source
Calls superclass method

    # File lib/active_record/errors.rb, line 74
    def initialize(message, record = nil)
      @record = record
      super(message)
    end