aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/referential.rb
diff options
context:
space:
mode:
authorTeddy Wing2017-11-29 17:08:56 +0100
committerTeddy Wing2017-11-29 17:12:30 +0100
commit6e8eada24b19f1d0b4f58da69a54278caec7429d (patch)
treefd5d77e7946a658e98fc6d3ddb76211c8a6bbc70 /app/models/referential.rb
parent8e9eb5d09ec8aa482afe33c7009c9ab78fdc6ede (diff)
downloadchouette-core-6e8eada24b19f1d0b4f58da69a54278caec7429d.tar.bz2
Referential: Add a comment about the `lock_table` callback
Make it clear in the code (not just in the commit message) that this callback must go last. Refs #5024
Diffstat (limited to 'app/models/referential.rb')
-rw-r--r--app/models/referential.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/referential.rb b/app/models/referential.rb
index a8f387122..6912f140f 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -192,7 +192,10 @@ class Referential < ActiveRecord::Base
before_validation :assign_line_and_stop_area_referential, :on => :create, if: :workbench
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
before_validation :lock_table, :on => :create
+
before_create :create_schema
after_create :clone_schema, if: :created_from