Generate filename

This commit is contained in:
2023-01-31 19:09:42 +11:00
parent f7f6bf0979
commit 24b4ba6854

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "securerandom"
module Adamantium
module Commands
module Media
@@ -9,7 +11,7 @@ module Adamantium
def call(file:)
pathname = Time.now.strftime("%m-%Y")
filename = file[:filename].split("/").last
filename = "#{SecureRandom.uuid}#{File.extname(file[:filename])}"
dirname = File.join("public", "media", pathname)