You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sequential file names (if file test.jpg exists, name the next one test_2.jpg)
Revisioning (Do not delete files, so old file paths are still valid)
Problems:
When setting files on creation Model.create(files: [file1, file2, file3]) I think the filename method is called for all files before any of the files is stored, so if all files are named 'test.jpg', for all calls the file does not exist and the serialized json in the db is ['test.jpg', 'test.jpg', 'test.jpg']
When adding files like model.files += [file4, file5] all files, even file1, file2 and file3 are reprocessed, and there is no way to distinguish already stored files, with the result that all files get new filenames and are stored again.
I am trying to achieve two things:
Problems:
Model.create(files: [file1, file2, file3])
I think the filename method is called for all files before any of the files is stored, so if all files are named 'test.jpg', for all calls the file does not exist and the serialized json in the db is ['test.jpg', 'test.jpg', 'test.jpg']model.files += [file4, file5]
all files, even file1, file2 and file3 are reprocessed, and there is no way to distinguish already stored files, with the result that all files get new filenames and are stored again.Model
Uploader
The only solution I could think of was using an ActiveRecord 'Helper' Model that adds the files, which is only possible after a record exists:
So as you can see this is a pretty big workaround.. Any ideas how to solve this problem?
What I think would help is a way to distinguish already stored Uploaders from the newly added ones.
I think this is where it happens:
carrierwave/lib/carrierwave/mounter.rb
Line 40 in 97c028c
The text was updated successfully, but these errors were encountered: