summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/bridge.rb4
-rw-r--r--app/models/commit_status.rb1
-rw-r--r--app/models/namespace.rb8
-rw-r--r--app/models/user_preference.rb2
4 files changed, 8 insertions, 7 deletions
diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb
index b77e0f1d5c1..7cdd0d56a98 100644
--- a/app/models/ci/bridge.rb
+++ b/app/models/ci/bridge.rb
@@ -79,7 +79,9 @@ module Ci
case pipeline.status
when 'success'
success!
- when 'failed', 'canceled', 'skipped'
+ when 'canceled'
+ cancel!
+ when 'failed', 'skipped'
drop!
else
false
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index da427a7e068..6dfea7ef9a7 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -68,6 +68,7 @@ class CommitStatus < Ci::ApplicationRecord
where("#{quoted_table_name}.scheduled_at IS NOT NULL AND #{quoted_table_name}.scheduled_at < ?", date)
}
scope :with_when_executed, ->(when_executed) { where(when: when_executed) }
+ scope :with_type, ->(type) { where(type: type) }
# The scope applies `pluck` to split the queries. Use with care.
scope :for_project_paths, -> (paths) do
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 146ce2aa5b6..7c6fa24cd4d 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -396,12 +396,8 @@ class Namespace < ApplicationRecord
# Includes projects from this namespace and projects from all subgroups
# that belongs to this namespace
def all_projects
- if Feature.enabled?(:recursive_approach_for_all_projects)
- namespace = user_namespace? ? self : self_and_descendant_ids
- Project.where(namespace: namespace)
- else
- Project.inside_path(full_path)
- end
+ namespace = user_namespace? ? self : self_and_descendant_ids
+ Project.where(namespace: namespace)
end
def has_parent?
diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb
index 9c40376bb13..90449411f8a 100644
--- a/app/models/user_preference.rb
+++ b/app/models/user_preference.rb
@@ -29,6 +29,8 @@ class UserPreference < ApplicationRecord
ignore_columns :experience_level, remove_with: '14.10', remove_after: '2021-03-22'
ignore_columns :time_format_in_24h, remove_with: '16.2', remove_after: '2023-07-22'
+ # 2023-06-22 is after 16.1 release and during 16.2 release https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#ignoring-the-column-release-m
+ ignore_columns :use_legacy_web_ide, remove_with: '16.2', remove_after: '2023-06-22'
attribute :tab_width, default: -> { Gitlab::TabWidth::DEFAULT }
attribute :time_display_relative, default: true