Skip to content

Instantly share code, notes, and snippets.

@fedesoria
Created April 14, 2011 03:27
Show Gist options
  • Save fedesoria/918844 to your computer and use it in GitHub Desktop.
Save fedesoria/918844 to your computer and use it in GitHub Desktop.
Paperclip Scopes
# For finding images as in Article.attachments.images
scope :images, where("file_content_type LIKE ?", "image%")
# For finding other files Article.attachments.docs
scope :docs, where("file_content_type NOT LIKE ?", "image%")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment