From 8f80b12391d08847cd3513837fd27f5ed4f76471 Mon Sep 17 00:00:00 2001 From: Sebastian van Hesteren Date: Tue, 18 Jun 2024 15:28:24 +0200 Subject: [PATCH] Rescue ActiveRecord::StatementInvalid --- lib/gouda/railtie.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gouda/railtie.rb b/lib/gouda/railtie.rb index 2a41584..f87a9af 100644 --- a/lib/gouda/railtie.rb +++ b/lib/gouda/railtie.rb @@ -54,7 +54,7 @@ class Railtie < Rails::Railtie Gouda::Scheduler.build_scheduler_entries_list! begin Gouda::Scheduler.upsert_workloads_from_entries_list! - rescue PG::UndefinedTable, ActiveRecord::NoDatabaseError + rescue PG::UndefinedTable, ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid # Do nothing. On a freshly checked-out Rails app, running even unrelated Rails tasks # (such as asset compilation) - or, more importantly, initial db:create - # will cause a NoDatabaseError, as this is a chicken-and-egg problem. That error