Open billie66 opened 9 years ago
若上传文件采用随机名,且更新文件时用到 recreate_versions 方法,会重新生成文件名, 但文件内容不更新,仍然是原来的文件。
http://www.davidverhasselt.com/set-attributes-in-activerecord/
https://github.com/carrierwaveuploader/carrierwave/wiki/How-to:-Create-random-and-unique-filenames-for-all-versioned-files
按照上面文档中定义 filename 可以避免这个问题
若上传文件采用随机名,且更新文件时用到 recreate_versions 方法,会重新生成文件名, 但文件内容不更新,仍然是原来的文件。