I'm trying to duplicate my record and using the amoeba gem. Everything copies fine except for the image (which is uploader via carrierwave)
For the image I tried doing a customized setting in amoeba like this:
amoeba do
customize(lamba { |original_object, new_object|
new_object.photo = original_object.photo
})
but that just returned the path of the image still which when loading is looking in the individual record id.
Edit: ok so I install the copy_carrierwave_file gem and tried to implement it but it doesnt seem to work. I am calling this function in the after_save callback
def create_duplicate
puts 'Starting duplication'
new_recipe = self.amoeba_dup
new_recipe.original_id = self.id
CopyCarrierwaveFile::CopyFileService.new(self, new_recipe, :photo).set_file
new_recipe.save
end
I dont get any errors in the server or anywhere but it doesnt do anything