mirror of
https://github.com/docusealco/docuseal
synced 2026-11-07 07:22:32 -05:00
add uuid to active storage blob
This commit is contained in:
1 parent
652072d660
commit
5a3174a720
3 files changed
+22
-1
No files matched your search
@@ -19,6 +19,16 @@ ActiveSupport.on_load(:active_storage_attachment) do
|
||||
end
|
||||
|
||||
ActiveSupport.on_load(:active_storage_blob) do
|
||||
attribute :uuid, :string, default: -> { SecureRandom.uuid }
|
||||
|
||||
def uuid
|
||||
super || begin
|
||||
new_uuid = SecureRandom.uuid
|
||||
update_columns(uuid: new_uuid)
|
||||
new_uuid
|
||||
end
|
||||
end
|
||||
|
||||
def delete
|
||||
service.delete(key)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user