Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overridden filename not stored in the database #84

Closed
AppyCat opened this issue Oct 29, 2017 · 4 comments
Closed

Overridden filename not stored in the database #84

AppyCat opened this issue Oct 29, 2017 · 4 comments

Comments

@AppyCat
Copy link

AppyCat commented Oct 29, 2017

The below works to rename the file, but it does not rename what is stored in the database as the name of the file.

def filename(version, _) do
"#{UUID.uuid1()}"
end

The file name in the database remains the original file name, instead of the overridden version from the uuid above.

If the filename and what is stored in the db differ, the system is broken. Carrierwave updates the db with the new overridden file name. Is it possible to do the same with arc_ecto?

@pedep
Copy link

pedep commented Jan 4, 2018

see stavro/arc#85 and related issues for more

@pedep
Copy link

pedep commented Jan 12, 2018

Duplicate of stavro/arc#85

@stavro stavro closed this as completed Jan 12, 2018
@williamweckl
Copy link

@pedep I don't think this issue is the same as #85, it is the same problem reported at issue #69 but you closed both...

I'm having the same problem that @AppyCat reported. When I use the functions to retrieve the right filename is returned but at the database it saves the original filename from upload. The problem of doing that is if I change my filename or thumbnails strategy I lose compatibility with the old ones... Maybe use a JSON field to store all version names?

@pedep
Copy link

pedep commented Feb 26, 2018

@williamweckl
These issues may not be exactly the same, but they are similar enough that i believe solving one would mean solving all of them.

I'm not sure storing JSON in the database is the correct approach, since that would pose problems with databases that does not support embedded schema.

Do you think you could elaborate on what behavior you expect when changing the filename method? I'm pretty sure, that if you change your naming strategy in something like carrierwave, you would also have problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants