Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-26 00:09:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-26 00:09:13 +0300
commit659ad26b4e0e1f792ab6d15ac8d6e47ec943e214 (patch)
tree5e395d172b681cfe396c671ebf7eef8789ef7334 /app/models
parente93121b42cb4ca672c893c6be0a8af0c8d9f7987 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/namespace.rb11
-rw-r--r--app/models/namespace_setting.rb2
-rw-r--r--app/models/raw_usage_data.rb4
3 files changed, 5 insertions, 12 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index e6809316274..13ab542b5d9 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -15,6 +15,8 @@ class Namespace < ApplicationRecord
include Namespaces::Traversal::Recursive
include Namespaces::Traversal::Linear
+ ignore_column :delayed_project_removal, remove_with: '14.1', remove_after: '2021-05-22'
+
# Prevent users from creating unreasonably deep level of nesting.
# The number 20 was taken based on maximum nesting level of
# Android repo (15) + some extra backup.
@@ -84,8 +86,6 @@ class Namespace < ApplicationRecord
before_destroy(prepend: true) { prepare_for_destroy }
after_destroy :rm_dir
- before_save :ensure_delayed_project_removal_assigned_to_namespace_settings, if: :delayed_project_removal_changed?
-
scope :for_user, -> { where('type IS NULL') }
scope :sort_by_type, -> { order(Gitlab::Database.nulls_first_order(:type)) }
scope :include_route, -> { includes(:route) }
@@ -408,13 +408,6 @@ class Namespace < ApplicationRecord
private
- def ensure_delayed_project_removal_assigned_to_namespace_settings
- return if Feature.disabled?(:migrate_delayed_project_removal, default_enabled: true)
-
- self.namespace_settings || build_namespace_settings
- namespace_settings.delayed_project_removal = delayed_project_removal
- end
-
def all_projects_with_pages
if all_projects.pages_metadata_not_migrated.exists?
Gitlab::BackgroundMigration::MigratePagesMetadata.new.perform_on_relation(
diff --git a/app/models/namespace_setting.rb b/app/models/namespace_setting.rb
index 50844403d7f..04f778268d6 100644
--- a/app/models/namespace_setting.rb
+++ b/app/models/namespace_setting.rb
@@ -8,7 +8,7 @@ class NamespaceSetting < ApplicationRecord
before_validation :normalize_default_branch_name
- NAMESPACE_SETTINGS_PARAMS = [:default_branch_name].freeze
+ NAMESPACE_SETTINGS_PARAMS = [:default_branch_name, :delayed_project_removal].freeze
self.primary_key = :namespace_id
diff --git a/app/models/raw_usage_data.rb b/app/models/raw_usage_data.rb
index 06cd4ad3f6c..6fe3b26b58b 100644
--- a/app/models/raw_usage_data.rb
+++ b/app/models/raw_usage_data.rb
@@ -4,7 +4,7 @@ class RawUsageData < ApplicationRecord
validates :payload, presence: true
validates :recorded_at, presence: true, uniqueness: true
- def update_sent_at!
- self.update_column(:sent_at, Time.current)
+ def update_version_metadata!(usage_data_id:)
+ self.update_columns(sent_at: Time.current, version_usage_data_id_value: usage_data_id)
end
end