Permalink
Browse files

Merge pull request #12560 from sue445/modify_find_lock_sample_code

avoid deprecation warning in sample code [ci skip]
  • Loading branch information...
2 parents 7ec3f35 + a913af9 commit db82e1d0bb21c2a13354b97733c09737719e946b @senny senny committed Oct 18, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/locking/pessimistic.rb
@@ -3,12 +3,12 @@ module Locking
# Locking::Pessimistic provides support for row-level locking using
# SELECT ... FOR UPDATE and other lock types.
#
- # Pass <tt>lock: true</tt> to <tt>ActiveRecord::Base.find</tt> to obtain an exclusive
+ # Chain <tt>ActiveRecord::Base#find</tt> to <tt>ActiveRecord::QueryMethods#lock</tt> to obtain an exclusive
# lock on the selected rows:
# # select * from accounts where id=1 for update
- # Account.find(1, lock: true)
+ # Account.lock.find(1)
#
- # Pass <tt>lock: 'some locking clause'</tt> to give a database-specific locking clause
+ # Call <tt>lock('some locking clause')</tt> to use a database-specific locking clause
# of your own such as 'LOCK IN SHARE MODE' or 'FOR UPDATE NOWAIT'. Example:
#
# Account.transaction do

0 comments on commit db82e1d

Please sign in to comment.