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
Was hoping this was fixed with 3.0.1, but it still occurs. When updating an uploader with the same file, the underlying stored filename is deduplicated, but the active_record filename stays the same. This is the minimal example....
doc = File.open(File.expand_path('../../fixtures/files/Example Annotated Document.pdf', __FILE__))
r = Release.create!
r.signed_electronic_document = doc
r.save!
puts "After Initial Save -----------"
puts "url : #{r.signed_electronic_document.url}"
puts "ar name : #{r.signed_electronic_document_filename}"
puts "store_dir files"
puts Dir["/home/app/myapp/private/#{r.signed_electronic_document.store_dir}/*.pdf"]
puts ""
#update with same document
r.assign_attributes(verified: true, signed_electronic_document: doc)
r.save!
puts "After Second Save -----------"
puts "url : #{r.signed_electronic_document.url}"
puts "ar name : #{r.signed_electronic_document_filename}"
puts "store_dir files"
puts Dir["/home/app/myapp/private/#{r.signed_electronic_document.store_dir}/*.pdf"]
This is the output...
After Initial Save -----------
url : /uploads/release/signed_document/980191116/Example_Annotated_Document.pdf
ar name : Example_Annotated_Document.pdf
store_dir files
/home/app/myapp/private/uploads/release/signed_document/980191116/Example_Annotated_Document.pdf
After Second Save -----------
url : /uploads/release/signed_document/980191116/Example_Annotated_Document(2).pdf
ar name : Example_Annotated_Document.pdf
store_dir files
/home/app/myapp/private/uploads/release/signed_document/980191116/Example_Annotated_Document(2).pdf
And sure enough, if you try to load the object and read the file
r.reload
r.signed_electronic_document.read
you receive...
Errno::ENOENT: No such file or directory @ rb_sysopen - /home/app/myapp/private/uploads/release/signed_document/980191116/Example_Annotated_Document.pdf
Expect that the active_record filename and underlying storage should remain synched
PS. A config setting to toggle off/on carrierwave's deduplication efforts would be useful
The text was updated successfully, but these errors were encountered:
Was hoping this was fixed with 3.0.1, but it still occurs. When updating an uploader with the same file, the underlying stored filename is deduplicated, but the active_record filename stays the same. This is the minimal example....
This is the output...
And sure enough, if you try to load the object and read the file
you receive...
Expect that the active_record filename and underlying storage should remain synched
PS. A config setting to toggle off/on carrierwave's deduplication efforts would be useful
The text was updated successfully, but these errors were encountered: