Commit 42b582f4 authored by Thong Kuah's avatar Thong Kuah

Rename base model to avoid Rails getting the wrong ApplicationRecord

We have accidentally caused all CI models to use Ci::ApplicationRecord
when we only want Ci::InstanceVariable to do so
parent 97dced24
......@@ -7,7 +7,7 @@ module Ci
# This class is part of a migration to move all CI classes to a new separate database.
# Initially we are only going to be moving the `Ci::InstanceVariable` model and it will be duplicated in the main and CI tables
# Do not extend this class in any other models.
class ApplicationRecord < ::ApplicationRecord
class BaseModel < ::ApplicationRecord
self.abstract_class = true
if Gitlab::Database.has_config?(:ci)
......
# frozen_string_literal: true
module Ci
class InstanceVariable < ::Ci::ApplicationRecord
class InstanceVariable < ::Ci::BaseModel
extend Gitlab::Ci::Model
extend Gitlab::ProcessMemoryCache::Helper
include Ci::NewHasVariable
......
......@@ -95,7 +95,7 @@ database. This is to match the default name Rails has.
### Migrations
Any migrations that affect `Ci::ApplicationRecord` models
Any migrations that affect `Ci::BaseModel` models
and their tables must be placed in two directories for now:
- `db/migrate`
......
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