mirror of https://github.com/rails/rails
Merge pull request #21742 from vngrs/fix_ar_locking_doc
Fix ActiveRecord::Locking doc [ci skip]
This commit is contained in:
commit
e19f1c3f71
|
@ -22,7 +22,7 @@ module ActiveRecord
|
|||
# p1.save
|
||||
#
|
||||
# p2.first_name = "should fail"
|
||||
# p2.save # Raises a ActiveRecord::StaleObjectError
|
||||
# p2.save # Raises an ActiveRecord::StaleObjectError
|
||||
#
|
||||
# Optimistic locking will also check for stale data when objects are destroyed. Example:
|
||||
#
|
||||
|
@ -32,7 +32,7 @@ module ActiveRecord
|
|||
# p1.first_name = "Michael"
|
||||
# p1.save
|
||||
#
|
||||
# p2.destroy # Raises a ActiveRecord::StaleObjectError
|
||||
# p2.destroy # Raises an ActiveRecord::StaleObjectError
|
||||
#
|
||||
# You're then responsible for dealing with the conflict by rescuing the exception and either rolling back, merging,
|
||||
# or otherwise apply the business logic needed to resolve the conflict.
|
||||
|
|
Loading…
Reference in New Issue