Created
January 14, 2015 13:11
-
-
Save aypn0s/c2947c152a8e42e38436 to your computer and use it in GitHub Desktop.
Carrierwave delete folders after destroy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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