diff --git a/config/initializers/logo.rb b/config/initializers/logo.rb index e935f1d85..0ec456f1d 100644 --- a/config/initializers/logo.rb +++ b/config/initializers/logo.rb @@ -2,11 +2,14 @@ Rails.application.reloader.to_prepare do - next if !ActiveRecord::Base.connected? + begin + # sync logo to fs / only if settings already exists + next if ActiveRecord::Base.connection.tables.exclude?('settings') - # sync logo to fs / only if settings already exists - next if ActiveRecord::Base.connection.tables.exclude?('settings') - next if Setting.column_names.exclude?('state_current') + next if Setting.column_names.exclude?('state_current') - StaticAssets.sync + StaticAssets.sync + rescue ::ActiveRecord::NoDatabaseError + Rails.logger.debug("Database doesn't exist. Skipping StaticAssets.sync") + end end