Generate filename
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "securerandom"
|
||||||
|
|
||||||
module Adamantium
|
module Adamantium
|
||||||
module Commands
|
module Commands
|
||||||
module Media
|
module Media
|
||||||
@@ -9,7 +11,7 @@ module Adamantium
|
|||||||
def call(file:)
|
def call(file:)
|
||||||
pathname = Time.now.strftime("%m-%Y")
|
pathname = Time.now.strftime("%m-%Y")
|
||||||
|
|
||||||
filename = file[:filename].split("/").last
|
filename = "#{SecureRandom.uuid}#{File.extname(file[:filename])}"
|
||||||
|
|
||||||
dirname = File.join("public", "media", pathname)
|
dirname = File.join("public", "media", pathname)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user