use discard
This commit is contained in:
parent
674c24c4f7
commit
1ce1c1e6d0
16 changed files with 41 additions and 69 deletions
|
@ -16,5 +16,7 @@ class Invite < ApplicationRecord
|
|||
# and Dossier from their respective `default_scope`s.
|
||||
# Therefore, we also remove `Invite`s for such effectively deleted `Dossier`s
|
||||
# from their default scope.
|
||||
default_scope { joins(:dossier).where(dossiers: { hidden_at: nil }) }
|
||||
scope :kept, -> { joins(:dossier).merge(Dossier.kept) }
|
||||
|
||||
default_scope { kept }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue