From 8199b2d3ceb76f90759831fee5dbdd67e0bc5d29 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Sat, 7 Jul 2018 14:49:16 +1100 Subject: [PATCH] [Rails5] Fix 'Invalid single-table inheritance type: Group is not a subclass of Gitlab::BackgroundMigration::FixCrossProjectLabelLinks::Namespace' --- ...kgroundmigration-fixcrossprojectlabellinks-namespace.yml | 6 ++++++ .../background_migration/fix_cross_project_label_links.rb | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 changelogs/unreleased/48976-rails5-invalid-single-table-inheritance-type-group-is-not-a-subclass-of-gitlab-backgroundmigration-fixcrossprojectlabellinks-namespace.yml diff --git a/changelogs/unreleased/48976-rails5-invalid-single-table-inheritance-type-group-is-not-a-subclass-of-gitlab-backgroundmigration-fixcrossprojectlabellinks-namespace.yml b/changelogs/unreleased/48976-rails5-invalid-single-table-inheritance-type-group-is-not-a-subclass-of-gitlab-backgroundmigration-fixcrossprojectlabellinks-namespace.yml new file mode 100644 index 00000000000..e95536b213c --- /dev/null +++ b/changelogs/unreleased/48976-rails5-invalid-single-table-inheritance-type-group-is-not-a-subclass-of-gitlab-backgroundmigration-fixcrossprojectlabellinks-namespace.yml @@ -0,0 +1,6 @@ +--- +title: "[Rails5] Fix 'Invalid single-table inheritance type: Group is not a subclass + of Gitlab::BackgroundMigration::FixCrossProjectLabelLinks::Namespace'" +merge_request: 20462 +author: "@blackst0ne" +type: fixed diff --git a/lib/gitlab/background_migration/fix_cross_project_label_links.rb b/lib/gitlab/background_migration/fix_cross_project_label_links.rb index fa68ba5cca7..0a12401c35f 100644 --- a/lib/gitlab/background_migration/fix_cross_project_label_links.rb +++ b/lib/gitlab/background_migration/fix_cross_project_label_links.rb @@ -11,6 +11,7 @@ module Gitlab end class Label < ActiveRecord::Base + self.inheritance_column = :_type_disabled self.table_name = 'labels' end @@ -27,6 +28,7 @@ module Gitlab end class Namespace < ActiveRecord::Base + self.inheritance_column = :_type_disabled self.table_name = 'namespaces' def self.groups_with_descendants_ids(start_id, stop_id)