Arc not storing file renaming in db

When I change filenaming in the uploader in Arc using a UUID, using Arc_ecto too, it renames the file fine and stores on S3, but not what’s stored in the db.

Here’s my file name override:

Override the persisted filenames:

def filename(version, _) do
UUID.uuid1()
end

It renames the file just fine, stores it just fine on s3, but the uuid is not reflected in the db.

Does anyone have any idea, I am use arc_ecto also. Perhaps I need to manually update the file name int he db to reflect the uuid?

Having the same issue. Have you found any solution or we must rename the structure stored in DB?

Thanks!

It seems currently the best solution is to do something like described on this comment on #15 issue.

  1. Add a new field on your model to store a unique identifier (UUID for example) and make sure it’s populated before cast_attachments/3.
  2. Update the uploader definition to use that field instead of id.

Full example on the link above.