debian-mirror-gitlab/app/services/packages/create_package_file_service.rb

23 lines
522 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
module Packages
class CreatePackageFileService
attr_reader :package, :params
def initialize(package, params)
@package = package
@params = params
end
def execute
package.package_files.create!(
file: params[:file],
size: params[:size],
file_name: params[:file_name],
file_sha1: params[:file_sha1],
file_sha256: params[:file_sha256],
file_md5: params[:file_md5]
)
end
end
end