w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
Edit
In Place Editing Advanced Editing
  • References
  • Ruby on Rails
  • Rails
  • Classes
  • ActiveRecord
  • ActiveRecord::Locking
  • ActiveRecord::Locking::Pessimistic

lock!

lock!(lock = true)
Instance Public methods

Obtain a row lock on this record. Reloads the record to obtain the requested lock. Pass an SQL locking clause to append the end of the SELECT statement or pass true for âFOR UPDATEâ (the default, an exclusive row lock). Returns the locked record.

Links:
  • https://github.com/rails/rails/blob/a913af96e0e46ca6637bca8f56282608628991eb/activerecord/lib/active_record/locking/pessimistic.rb#L61
doc_ruby_on_rails
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.

Popular Articles
asyncio.Lock.locked() locked() Return True if the lock is acquired.
_thread.lock.locked() lock.locked() Return the status of the lock: True if it has been acquired by some thread, False if not.
lock lock(locks = true) Instance Public methods Specifies locking settings (default to true). For more information on locking, please see Act
LOCK NameLOCK -- lock a table Synopsis LOCK [ TABLE ] [ ONLY ] name [ * ] [, ...] [ IN lockmode MODE ] [ NOWAIT ] where lockmode is one of: AC
lock lock(path, body, initheader = nil) Instance Public methods Sends a LOCK request to the path and gets a response, as an HTTPResponse obje


Return to View
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com

Our Partners: aeeble – Providing content publishing and search solutions