From 6e8eada24b19f1d0b4f58da69a54278caec7429d Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 29 Nov 2017 17:08:56 +0100 Subject: 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 --- app/models/referential.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/models/referential.rb') 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 -- cgit v1.2.3