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