diff options
| author | Teddy Wing | 2017-11-29 17:35:44 +0100 |
|---|---|---|
| committer | Teddy Wing | 2017-11-29 17:35:44 +0100 |
| commit | e90f92707abf1b2ba4d00f97e15888f6e29e8cbc (patch) | |
| tree | 8a496f957fded68215d4ce60818db08f22a2b38e | |
| parent | 6e8eada24b19f1d0b4f58da69a54278caec7429d (diff) | |
| download | chouette-core-e90f92707abf1b2ba4d00f97e15888f6e29e8cbc.tar.bz2 | |
Referential: Add comment to describe why we lock the table
Refs #5024
| -rw-r--r-- | app/models/referential.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/referential.rb b/app/models/referential.rb index 6912f140f..f78b4ec9a 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -193,7 +193,9 @@ class Referential < ActiveRecord::Base before_validation :assign_slug, :on => :create before_validation :assign_prefix, :on => :create - # Locking the table must be the last hook to minimise the duration of the lock + # Lock the `referentials` table to prevent duplicate referentials from being + # created simultaneously in separate transactions. This must be the last hook + # to minimise the duration of the lock. before_validation :lock_table, :on => :create before_create :create_schema |
