app/models/map.rb
#paperclip plugin deletes the images when model is destroyed
paperclip plugin deletes the images when model is destroyed
paperclip plugin deletes the images when model is destroyed
def delete_images
    logger.info "Deleting map images"
    if File.exists?(temp_filename)
      logger.info "deleted temp"
      File.delete(temp_filename)
    end
    if File.exists?(warped_filename)
      logger.info "Deleted Map warped"
      File.delete(warped_filename)
    end
    if File.exists?(warped_png)
      logger.info "deleted warped png"
      File.delete(warped_png)
    end
    if File.exists?(unwarped_filename)
      logger.info "deleting unwarped"
      File.delete unwarped_filename
    end
  end
def delete_images logger . info "Deleting map images" if File . exists? ( temp_filename ) logger . info "deleted temp" File . delete ( temp_filename ) end if File . exists? ( warped_filename ) logger . info "Deleted Map warped" File . delete ( warped_filename ) end if File . exists? ( warped_png ) logger . info "deleted warped png" File . delete ( warped_png ) end if File . exists? ( unwarped_filename ) logger . info "deleting unwarped" File . delete unwarped_filename end end
paperclip plugin deletes the images when model is destroyed
paperclip plugin deletes the images when model is destroyed