Skip to content

Instantly share code, notes, and snippets.

@danascheider
Created February 4, 2021 22:36
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 danascheider/983788a9c60456f7b9f0f880bbe87573 to your computer and use it in GitHub Desktop.
Save danascheider/983788a9c60456f7b9f0f880bbe87573 to your computer and use it in GitHub Desktop.
class File < ApplicationRecord
has_one_attached :file
scope :without_attached_file, -> { left_joins(:file_attachment).where('active_storage_attachments.id IS NULL') }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment