add archived filter

This commit is contained in:
Pete Matsyburka committed 2025-04-01 10:23:30 +03:00
1 parent e5db61e358
commit dd559e90f1
2 files changed
+5

No files matched your search

+1
View File
@@ -64,6 +64,7 @@ class Submission < ApplicationRecord
through: :template, source: :documents_attachments
scope :active, -> { where(archived_at: nil) }
scope :archived, -> { where.not(archived_at: nil) }
scope :pending, -> { joins(:submitters).where(submitters: { completed_at: nil }).group(:id) }
scope :completed, lambda {
where.not(Submitter.where(Submitter.arel_table[:submission_id].eq(Submission.arel_table[:id])