From c43e1cfbe5d3836daf3630650379d4d3e10aa8d0 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Tue, 20 Jul 2021 10:20:47 +0200 Subject: [PATCH] Fixed db error during build --- app/models/concerns/prefixed_id_model.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/prefixed_id_model.rb b/app/models/concerns/prefixed_id_model.rb index d7a571c9c..0527b1ae2 100644 --- a/app/models/concerns/prefixed_id_model.rb +++ b/app/models/concerns/prefixed_id_model.rb @@ -15,7 +15,8 @@ module PrefixedIdModel # rubocop:disable Rails/Output puts("\nWARNING missing index\n#{indexdef}\nfor prefixed id model #{name}!\n\n") unless index_exists # rubocop:enable Rails/Output - rescue ActiveRecord::NoDatabaseError # only applicable when setting up project + rescue ActiveRecord::NoDatabaseError, ActiveRecord::ConnectionNotEstablished + # only applicable during build and when setting up project end self::PREFIXED_ID_SQL = "('#{self::ID_PREFIX}' || #{table_name}.id)"