Skip to content

Instantly share code, notes, and snippets.

@aypn0s
Created January 14, 2015 13:11
Show Gist options
  • Select an option

  • Save aypn0s/c2947c152a8e42e38436 to your computer and use it in GitHub Desktop.

Select an option

Save aypn0s/c2947c152a8e42e38436 to your computer and use it in GitHub Desktop.
Carrierwave delete folders after destroy
after :remove, :delete_empty_dirs
def delete_empty_dirs
path = File.expand_path(store_dir, root)
Dir.rmdir(path)
rescue
true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment