diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /app/models/ci/secure_file.rb | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'app/models/ci/secure_file.rb')
-rw-r--r-- | app/models/ci/secure_file.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/models/ci/secure_file.rb b/app/models/ci/secure_file.rb index df38398e5a9..1e6c48bbef5 100644 --- a/app/models/ci/secure_file.rb +++ b/app/models/ci/secure_file.rb @@ -17,20 +17,19 @@ module Ci validates :file, presence: true, file_size: { maximum: FILE_SIZE_LIMIT } validates :checksum, :file_store, :name, :project_id, presence: true validates :name, uniqueness: { scope: :project } + + attribute :metadata, :ind_jsonb validates :metadata, json_schema: { filename: "ci_secure_file_metadata" }, allow_nil: true + attribute :file_store, default: -> { Ci::SecureFileUploader.default_store } + mount_file_store_uploader Ci::SecureFileUploader + after_initialize :generate_key_data before_validation :assign_checksum scope :order_by_created_at, -> { order(created_at: :desc) } scope :project_id_in, ->(ids) { where(project_id: ids) } - serialize :metadata, Serializers::Json # rubocop:disable Cop/ActiveRecordSerialize - - attribute :file_store, default: -> { Ci::SecureFileUploader.default_store } - - mount_file_store_uploader Ci::SecureFileUploader - def checksum_algorithm CHECKSUM_ALGORITHM end |