Skip to content

Instantly share code, notes, and snippets.

@the-teacher
Created May 12, 2013 12:05
Show Gist options
  • Save the-teacher/5563342 to your computer and use it in GitHub Desktop.
Save the-teacher/5563342 to your computer and use it in GitHub Desktop.
Rails 4 scope at has_many
has_many :attached_images, -> { where(attachment_content_type: "image/jpeg") }, as: :storage, class_name: AttachedFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment