2023-04-03 17:05:54 +02:00
|
|
|
class DossierCorrection < ApplicationRecord
|
2023-02-28 15:06:39 +01:00
|
|
|
belongs_to :dossier
|
|
|
|
belongs_to :commentaire
|
2023-02-28 15:11:48 +01:00
|
|
|
|
2023-06-02 12:43:08 +02:00
|
|
|
validates_associated :commentaire
|
|
|
|
|
2023-02-28 15:11:48 +01:00
|
|
|
scope :pending, -> { where(resolved_at: nil) }
|
2023-06-02 15:46:23 +02:00
|
|
|
|
2023-07-12 12:00:52 +02:00
|
|
|
enum reason: { incorrect: 'incorrect', incomplete: 'incomplete' }, _prefix: :dossier
|
2023-06-14 13:13:30 +02:00
|
|
|
|
2023-06-02 15:46:23 +02:00
|
|
|
def resolved?
|
|
|
|
resolved_at.present?
|
|
|
|
end
|
2023-02-28 15:06:39 +01:00
|
|
|
end
|