From 5f97550a1f8688ef5ca68449b73ca41611cf97be Mon Sep 17 00:00:00 2001 From: Peter Leitzen <pleitzen@gitlab.com> Date: Fri, 24 May 2024 15:44:31 +0200 Subject: [PATCH] Remove ancient EE::Model and EE::LegacyModel --- .rubocop_todo/gitlab/bounded_contexts.yml | 2 -- .rubocop_todo/style/redundant_self.yml | 2 -- doc/development/ee_features.md | 6 +++--- ee/lib/ee/legacy_model.rb | 13 ------------- ee/lib/ee/model.rb | 13 ------------- 5 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 ee/lib/ee/legacy_model.rb delete mode 100644 ee/lib/ee/model.rb diff --git a/.rubocop_todo/gitlab/bounded_contexts.yml b/.rubocop_todo/gitlab/bounded_contexts.yml index 1ee0964e0a4308..8614ac868c6ded 100644 --- a/.rubocop_todo/gitlab/bounded_contexts.yml +++ b/.rubocop_todo/gitlab/bounded_contexts.yml @@ -4298,8 +4298,6 @@ Gitlab/BoundedContexts: - 'ee/lib/ee/event_filter.rb' - 'ee/lib/ee/feature.rb' - 'ee/lib/ee/feature/definition.rb' - - 'ee/lib/ee/legacy_model.rb' - - 'ee/lib/ee/model.rb' - 'ee/lib/ee/sidebars/admin/menus/admin_settings_menu.rb' - 'ee/lib/ee/sidebars/admin/menus/monitoring_menu.rb' - 'ee/lib/ee/sidebars/admin/panel.rb' diff --git a/.rubocop_todo/style/redundant_self.yml b/.rubocop_todo/style/redundant_self.yml index 93d0b0298bf47d..a18d883a5170a8 100644 --- a/.rubocop_todo/style/redundant_self.yml +++ b/.rubocop_todo/style/redundant_self.yml @@ -216,8 +216,6 @@ Style/RedundantSelf: - 'ee/lib/ee/gitlab/auth/ldap/sync/users.rb' - 'ee/lib/ee/gitlab/background_migration/delete_invalid_epic_issues.rb' - 'ee/lib/ee/gitlab/database.rb' - - 'ee/lib/ee/legacy_model.rb' - - 'ee/lib/ee/model.rb' - 'ee/lib/elastic/instance_proxy_util.rb' - 'ee/lib/elastic/latest/commit_config.rb' - 'ee/lib/elastic/latest/issue_config.rb' diff --git a/doc/development/ee_features.md b/doc/development/ee_features.md index e65b604344e649..89d6a480eee583 100644 --- a/doc/development/ee_features.md +++ b/doc/development/ee_features.md @@ -651,10 +651,10 @@ end ### Code in `app/models/` -EE-specific models should `extend EE::Model`. +EE-specific models should be defined in `ee/app/models/`. -For example, if EE has a specific `Tanuki` model, you would -place it in `ee/app/models/ee/tanuki.rb`. +To override a CE model create the file in +`ee/app/models/ee/` and add new code to a `prepended` block. ActiveRecord `enums` should be entirely [defined in FOSS](database/creating_enums.md#all-of-the-keyvalue-pairs-should-be-defined-in-foss). diff --git a/ee/lib/ee/legacy_model.rb b/ee/lib/ee/legacy_model.rb deleted file mode 100644 index 8af13b3c75d473..00000000000000 --- a/ee/lib/ee/legacy_model.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module EE - module LegacyModel - def table_name_prefix - '' - end - - def model_name - @model_name ||= ActiveModel::Name.new(self, nil, self.name.demodulize) - end - end -end diff --git a/ee/lib/ee/model.rb b/ee/lib/ee/model.rb deleted file mode 100644 index 092fa1ea038757..00000000000000 --- a/ee/lib/ee/model.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module EE - module Model - def table_name_prefix - 'ee_' - end - - def model_name - @model_name ||= ActiveModel::Name.new(self, nil, self.name.demodulize) - end - end -end -- GitLab