copy_carrierwave_file icon indicating copy to clipboard operation
copy_carrierwave_file copied to clipboard

Rename file name issues

Open itayariely opened this issue 8 years ago • 1 comments

@equivalent Hi, I trying to rename the duplicated file:

class Attachment < ActiveRecord::Base mount_uploader :attachment, AttachmentUploader belongs_to :attachmentable, polymorphic: true include CopyCarrierwaveFile def duplicate_file(original) copy_carrierwave_file(original, self, :attachment) self.save! end end

class AttachmentUploader < CarrierWave::Uploader::Base def filename "#{model.attachmentable.name}-REV##{model.attachmentable.ver}-SN##{model.attachmentable.doc.sn}.#{file.extension}".to_s.underscore end end

But the result is that the file is saved in the old name and in the new DB name.

itayariely avatar Apr 14 '17 13:04 itayariely

@itayariely sorry you need to provide more details / description / irb output. As of lack of details I don't understand your isses

equivalent avatar Apr 18 '17 06:04 equivalent