method
with_lock
v4.2.9 -
Show latest stable
- Class:
ActiveRecord::Locking::Pessimistic
with_lock(lock = true)public
Wraps the passed block in a transaction, locking the object before yielding. You can pass the SQL locking clause as argument (see lock!).