Spec-Zone.ru › Ruby on Rails 4.2

класс ActiveRecord::RecordNotDestroyed

Родитель:
ActiveRecord::ActiveRecordError

Вызывается методом ActiveRecord::Persistence#destroy!, если вызов destroy вернёт false.

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

Атрибуты

record[R]

Публичные Классовые Методы

new(message, record = nil) Показать исходный код
# File activerecord/lib/active_record/errors.rb, line 74
def initialize(message, record = nil)
  @record = record
  super(message)
end
Вызывает метод суперкласса

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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API