Created
October 7, 2010 17:38
-
-
Save tombruijn/615506 to your computer and use it in GitHub Desktop.
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
# Paperclip gem | |
# How to fix the issue with ImageMagick crashing on non-image files. | |
# Must be placed before has_attached_file | |
# Source: http://awesomeful.net/posts/33-attach-non-image-files-in-rails-with-paperclip | |
before_post_process :image? | |
def image? | |
!({your_model}_content_type =~ /^image.*/).nil? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment