Commit 671e19b6 authored by Stan Hu's avatar Stan Hu

Fix upgrade failure in EE displaying license

When upgrading to 12.8 EE, the initializer might fail with
`NoMethodError: undefined method `pluralize' for LicenseHelper:Module`
if the license neared expiry. This happened
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24998 changed the
database check so that the license warning would actually be displayed,
but inside an initializer `pluralize` is not available.

The easiest way to fix this now is to revert the database check to the
original version.

Closes https://gitlab.com/gitlab-org/gitlab/issues/207737
parent 01b90fc7
---
title: Fix upgrade failure in EE displaying license
merge_request: 25788
author:
type: fixed
......@@ -10,7 +10,7 @@ Gitlab.ee do
end
# Needed to run migration
if Gitlab::Database.cached_table_exists?('licenses')
if ActiveRecord::Base.connected? && ActiveRecord::Base.connection.table_exists?('licenses')
message = LicenseHelper.license_message(signed_in: true, is_admin: true, in_html: false)
if ::License.block_changes? && message.present?
warn "WARNING: #{message}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment