DEV: initial migration can fail

DEV: initial migration can fail

db:migrate can issue translations due to module loading localizing end user messages

This allows db:migrate to work even when db is blank

diff --git a/lib/freedom_patches/translate_accelerator.rb b/lib/freedom_patches/translate_accelerator.rb
index 89bba4f..b2a0f51 100644
--- a/lib/freedom_patches/translate_accelerator.rb
+++ b/lib/freedom_patches/translate_accelerator.rb
@@ -162,6 +162,12 @@ module I18n
       end
 
       by_site[locale].with_indifferent_access
+    rescue ActiveRecord::StatementInvalid => e
+      if PG::UndefinedTable === e.cause
+        {}
+      else
+        raise
+      end
     end
 
     def client_overrides_json(locale)

GitHub sha: 445d3051

1 Like