From 953eb09e086c8f2842512a62e56e32223b5bf974 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 13 Apr 2022 18:08:33 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/development/sql.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/development/sql.md') diff --git a/doc/development/sql.md b/doc/development/sql.md index c1f4ad39650..4b6153b7205 100644 --- a/doc/development/sql.md +++ b/doc/development/sql.md @@ -254,13 +254,13 @@ of records plucked. `MAX_PLUCK` defaults to `1_000` in `ApplicationRecord`. ## Inherit from ApplicationRecord -Most models in the GitLab codebase should inherit from `ApplicationRecord`, -rather than from `ActiveRecord::Base`. This allows helper methods to be easily -added. +Most models in the GitLab codebase should inherit from `ApplicationRecord` +or `Ci::ApplicationRecord` rather than from `ActiveRecord::Base`. This allows +helper methods to be easily added. An exception to this rule exists for models created in database migrations. As these should be isolated from application code, they should continue to subclass -from `ActiveRecord::Base`. +from `MigrationRecord` which is available only in migration context. ## Use UNIONs -- cgit v1.2.3