Allow details table to be missing for inside migration calls

This commit is contained in:
Oliver Günther
2026-04-29 11:20:49 +02:00
parent 7824d1d304
commit ce58ea26c5
+3
View File
@@ -263,6 +263,9 @@ module HasDetailsTable
def finalize_detail_delegation!(detail_class, foreign_key)
return if @_detail_delegation_set_up
# The detail table may not yet exist during early migrations on a fresh
# database. Skip — the next instance will retry once the table is there.
return unless ActiveRecord::Base.connected? && detail_class.table_exists?
@_detail_delegation_set_up = true