Merge pull request #9289 from demarches-simplifiees/new_pj_scheme
Change le nommage des pjs à %Y/%m/%d/sd/sd.....
This commit is contained in:
commit
3885864200
2 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue