add_lock!(sql, options)
public
Appends a locking clause to a SQL statement. *Modifies the sql
parameter*.
add_lock! 'SELECT * FROM suppliers', :lock => true
add_lock! 'SELECT * FROM suppliers', :lock => ' FOR UPDATE'
Show source
def add_lock!(sql, options)
case lock = options[:lock]
when true: sql << ' FOR UPDATE'
when String: sql << " #{lock}"
end
end