diff options
author | Xavier Noria <fxn@hashref.com> | 2012-04-05 04:52:44 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-04-05 04:52:44 -0700 |
commit | 4adaf7bab4412f491717d9935d1d05f3bec0b963 (patch) | |
tree | d3a670c6d928011b4bf98f05340249d8f8b1ef1b /guides | |
parent | a9398a7da4fa845a0182bd53273c607dae55b1ee (diff) | |
parent | 1f4f4d4ccb1fa5fa20779a54a0cbcc0b6699e87c (diff) | |
download | rails-4adaf7bab4412f491717d9935d1d05f3bec0b963.tar.gz rails-4adaf7bab4412f491717d9935d1d05f3bec0b963.tar.bz2 rails-4adaf7bab4412f491717d9935d1d05f3bec0b963.zip |
Merge pull request #5747 from mneisen/patch-1
Optimistic locking: lock_version needed type information.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_record_querying.textile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/active_record_querying.textile b/guides/source/active_record_querying.textile index 14d0ba9b28..c5755c8308 100644 --- a/guides/source/active_record_querying.textile +++ b/guides/source/active_record_querying.textile @@ -695,7 +695,7 @@ Optimistic locking allows multiple users to access the same record for edits, an <strong>Optimistic locking column</strong> -In order to use optimistic locking, the table needs to have a column called +lock_version+. Each time the record is updated, Active Record increments the +lock_version+ column. If an update request is made with a lower value in the +lock_version+ field than is currently in the +lock_version+ column in the database, the update request will fail with an +ActiveRecord::StaleObjectError+. Example: +In order to use optimistic locking, the table needs to have a column called +lock_version+ of type integer. Each time the record is updated, Active Record increments the +lock_version+ column. If an update request is made with a lower value in the +lock_version+ field than is currently in the +lock_version+ column in the database, the update request will fail with an +ActiveRecord::StaleObjectError+. Example: <ruby> c1 = Client.find(1) |