diff options
author | Sean McGivern <sean@gitlab.com> | 2019-04-24 17:08:20 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-04-24 17:08:20 +0300 |
commit | 5150802d0ab1b5a59637c86d6e82b747a126e12e (patch) | |
tree | 4cc5fa9428db91674fce33c990f4e6a23b0247e7 /app | |
parent | 240db73c964286e6501cdb6c7b0df85a3d6db696 (diff) | |
parent | 9b752791624ce618810b9d65251582e56c37dee7 (diff) |
Merge branch 'sh-disable-internal-ids-available-check' into 'master'
Always use internal ID tables in development and production
Closes #60718
See merge request gitlab-org/gitlab-ce!27544
Diffstat (limited to 'app')
-rw-r--r-- | app/models/internal_id.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/internal_id.rb b/app/models/internal_id.rb index 401b94d36e5..237401899db 100644 --- a/app/models/internal_id.rb +++ b/app/models/internal_id.rb @@ -87,12 +87,16 @@ class InternalId < ApplicationRecord end def available? - @available_flag ||= ActiveRecord::Migrator.current_version >= REQUIRED_SCHEMA_VERSION # rubocop:disable Gitlab/PredicateMemoization + return true unless Rails.env.test? + + Gitlab::SafeRequestStore.fetch(:internal_ids_available_flag) do + ActiveRecord::Migrator.current_version >= REQUIRED_SCHEMA_VERSION + end end # Flushes cached information about schema def reset_column_information - @available_flag = nil + Gitlab::SafeRequestStore[:internal_ids_available_flag] = nil super end end |