0

I'm trying to call event.destroy on an event in my app. Each event has an uploaded image using carrierwave. When I try to destroy an event that has had an image uploaded, and then the event gets edited and a new image gets uploaded I get returned the error Net::SFTP::StatusException (2, "no such file").

Any clue how to fix this? Nothing special is happening, just a simple image upload using carrierwave and carrierwave-sftp to upload it to an external server. When the event is destroyed I have a callback referencing a custom method (below) to remove the image.

Thanks SO!

event.rb model

after_destroy :delete_event_image

def delete_event_image
  self.remove_image!
end
DevanB
  • 377
  • 1
  • 6
  • 16

1 Answers1

0

Unless carrierwave-sftp is breaking this feature somehow, carrierwave already does this for you out of the box.

Taavo
  • 2,406
  • 1
  • 17
  • 17