提交 2c8fb682 编写于 作者: M Michael Koziarski

Show RecordInvalid in the documentation. References #10976 [kampers]


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8845 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 5396b0f3
module ActiveRecord
# Raised by save! and create! when the record is invalid. Use the
# record method to retrieve the record which did not validate.
# +record+ method to retrieve the record which did not validate.
# begin
# complex_operation_that_calls_save!_internally
# rescue ActiveRecord::RecordInvalid => invalid
# puts invalid.record.errors
# end
class RecordInvalid < ActiveRecordError #:nodoc:
class RecordInvalid < ActiveRecordError
attr_reader :record
def initialize(record)
@record = record
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册