feat(pj): change naming scheme to %Y/%m/%d/sd/sd.....

This commit is contained in:
simon lehericey 2023-07-10 10:51:06 +02:00 committed by LeSim
parent d2f1af0830
commit db70624398
2 changed files with 2 additions and 2 deletions

View file

@ -10,7 +10,7 @@ class PjsMigrationJob < ApplicationJob
client = service.client
container = service.container
old_key = blob.key
new_key = "#{blob.created_at.year}/#{old_key[0..1]}/#{old_key[2..3]}/#{old_key}"
new_key = "#{blob.created_at.strftime('%Y/%m/%d')}/#{old_key[0..1]}/#{old_key}"
excon_response = client.copy_object(container,
old_key,

View file

@ -10,7 +10,7 @@ ActiveSupport.on_load(:active_storage_blob) do
def self.generate_unique_secure_token(length: MINIMUM_TOKEN_LENGTH)
token = super
"#{Time.current.year}/#{token[0..1]}/#{token[2..3]}/#{token}"
"#{Time.current.strftime('%Y/%m/%d')}/#{token[0..1]}/#{token}"
end
end