Skip to content

Instantly share code, notes, and snippets.

@crivotz
Created June 11, 2015 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crivotz/3611e726ae2f38d3108d to your computer and use it in GitHub Desktop.
Save crivotz/3611e726ae2f38d3108d to your computer and use it in GitHub Desktop.
Check if image? and do resize
version :thumb, :if => :image? do
process :resize_to_fit => [50, 50]
end
protected
def image?(new_file)
new_file.content_type.include? 'image'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment