feat(dossier): pending resolution state
This commit is contained in:
parent
2c79ca94f5
commit
d73b96ea40
3 changed files with 37 additions and 0 deletions
|
@ -3,5 +3,12 @@ module DossierResolvableConcern
|
|||
|
||||
included do
|
||||
has_many :resolutions, class_name: 'DossierResolution', dependent: :destroy
|
||||
|
||||
def pending_resolution?
|
||||
# We don't want to show any alert if user is not allowed to modify the dossier
|
||||
return false unless en_construction?
|
||||
|
||||
resolutions.pending.exists?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,4 +12,6 @@
|
|||
class DossierResolution < ApplicationRecord
|
||||
belongs_to :dossier
|
||||
belongs_to :commentaire
|
||||
|
||||
scope :pending, -> { where(resolved_at: nil) }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue