diff --git a/config/initializers/006-ensure_login_hint.rb b/config/initializers/006-ensure_login_hint.rb index 895f451ffe..af583da87a 100644 --- a/config/initializers/006-ensure_login_hint.rb +++ b/config/initializers/006-ensure_login_hint.rb @@ -1,5 +1,8 @@ # Some sanity checking so we don't count on an unindexed column on boot -if User.limit(20).count < 20 && User.where(admin: true).human_users.count == 0 +if ActiveRecord::Base.connection.table_exists?(:users) && + User.limit(20).count < 20 && + User.where(admin: true).human_users.count == 0 + notice = if GlobalSetting.developer_emails.blank? "Congratulations, you installed Discourse! Unfortunately, no administrator emails were defined during setup, so finalizing the configuration may be difficult." @@ -17,6 +20,4 @@ if User.limit(20).count < 20 && User.where(admin: true).human_users.count == 0 SiteSetting.global_notice = notice SiteSetting.has_login_hint = true end - - # we may be booting with no User table eg: first migration, just skip -end rescue nil +end