debian-mirror-gitlab/app/services/issuable/import_csv/base_service.rb
2023-04-23 21:23:45 +05:30

28 lines
651 B
Ruby

# frozen_string_literal: true
module Issuable
module ImportCsv
class BaseService < ::ImportCsv::BaseService
extend ::Gitlab::Utils::Override
private
override :attributes_for
def attributes_for(row)
{
title: row[:title],
description: row[:description],
due_date: row[:due_date]
}
end
override :validate_headers_presence!
def validate_headers_presence!(headers)
headers.downcase! if headers
return if headers && headers.include?('title') && headers.include?('description')
raise CSV::MalformedCSVError
end
end
end
end