Permalink
Browse files

[ci skip] avoid deprecation warning in sample code

Account.find(1, lock: true)
-> DEPRECATION WARNING: Passing options to #find is deprecated. Please build a scope and then call #find on it.
  • Loading branch information...
sue445 committed Oct 16, 2013
1 parent 49bc23f commit a913af96e0e46ca6637bca8f56282608628991eb
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 a913af9

Please sign in to comment.