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>2023-02-08 15:10:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-08 15:10:06 +0300
commitd0aeb5df3d6b06165355b023a25b79c7bd74a27d (patch)
tree7b5d3ff0f0ac5c124aa8626aeb4a0682d99a17c2 /app/models
parent9ccf40d15a14e9ccf613701ba7e3d5d250961345 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/appearance.rb8
-rw-r--r--app/models/ci/pipeline.rb2
-rw-r--r--app/models/sent_notification.rb4
3 files changed, 13 insertions, 1 deletions
diff --git a/app/models/appearance.rb b/app/models/appearance.rb
index 34cc8d1a64d..833f2335774 100644
--- a/app/models/appearance.rb
+++ b/app/models/appearance.rb
@@ -5,6 +5,8 @@ class Appearance < ApplicationRecord
include CacheMarkdownField
include WithUploads
+ ALLOWED_PWA_ICON_SCALER_WIDTHS = [192, 512].freeze
+
attribute :title, default: ''
attribute :description, default: ''
attribute :pwa_name, default: ''
@@ -61,6 +63,12 @@ class Appearance < ApplicationRecord
end
end
+ def pwa_icon_path_scaled(width)
+ return unless pwa_icon_path.present?
+
+ pwa_icon_path + "?width=#{width}"
+ end
+
def logo_path
logo_system_path(logo, 'logo')
end
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 7a606c0b417..21d17f11c50 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -355,7 +355,7 @@ module Ci
scope :for_name, -> (name) do
name_column = Ci::PipelineMetadata.arel_table[:name]
- joins(:pipeline_metadata).where(name_column.lower.eq(name.downcase))
+ joins(:pipeline_metadata).where(name_column.eq(name))
end
scope :created_after, -> (time) { where(arel_table[:created_at].gt(time)) }
scope :created_before_id, -> (id) { where(arel_table[:id].lt(id)) }
diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb
index 8fea0d6d993..1a0a65df6a3 100644
--- a/app/models/sent_notification.rb
+++ b/app/models/sent_notification.rb
@@ -1,6 +1,8 @@
# frozen_string_literal: true
class SentNotification < ApplicationRecord
+ include IgnorableColumns
+
serialize :position, Gitlab::Diff::Position # rubocop:disable Cop/ActiveRecordSerialize
belongs_to :project
@@ -14,6 +16,8 @@ class SentNotification < ApplicationRecord
validates :in_reply_to_discussion_id, format: { with: /\A\h{40}\z/, allow_nil: true }
validate :note_valid
+ ignore_column :id_convert_to_bigint, remove_with: '16.0', remove_after: '2023-05-22'
+
after_save :keep_around_commit, if: :for_commit?
class << self