Created
February 4, 2021 22:36
-
-
Save danascheider/983788a9c60456f7b9f0f880bbe87573 to your computer and use it in GitHub Desktop.
This file contains 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
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