mirror of
https://github.com/github/rails.git
synced 2026-01-28 15:58:03 -05:00
Show RecordInvalid in the documentation. References #10976 [kampers]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8845 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user