chore(schema): create dossier_corrections
This commit is contained in:
parent
5d245fee7d
commit
2c79ca94f5
8 changed files with 68 additions and 0 deletions
|
@ -19,6 +19,7 @@ class Commentaire < ApplicationRecord
|
|||
|
||||
belongs_to :instructeur, inverse_of: :commentaires, optional: true
|
||||
belongs_to :expert, inverse_of: :commentaires, optional: true
|
||||
has_one :dossier_resolution, inverse_of: :commentaire, dependent: :nullify
|
||||
|
||||
validate :messagerie_available?, on: :create, unless: -> { dossier.brouillon? }
|
||||
|
||||
|
|
7
app/models/concerns/dossier_resolvable_concern.rb
Normal file
7
app/models/concerns/dossier_resolvable_concern.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
module DossierResolvableConcern
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
has_many :resolutions, class_name: 'DossierResolution', dependent: :destroy
|
||||
end
|
||||
end
|
|
@ -50,6 +50,7 @@ class Dossier < ApplicationRecord
|
|||
include DossierFilteringConcern
|
||||
include DossierPrefillableConcern
|
||||
include DossierRebaseConcern
|
||||
include DossierResolvableConcern
|
||||
include DossierSearchableConcern
|
||||
include DossierSectionsConcern
|
||||
include DossierCloneConcern
|
||||
|
|
15
app/models/dossier_resolution.rb
Normal file
15
app/models/dossier_resolution.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: dossier_resolutions
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# resolved_at :datetime
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# commentaire_id :bigint
|
||||
# dossier_id :bigint not null
|
||||
#
|
||||
class DossierResolution < ApplicationRecord
|
||||
belongs_to :dossier
|
||||
belongs_to :commentaire
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue