refactor(messagerie): preload commentaires with corrections & attachments blobs
This commit is contained in:
parent
7f871728c7
commit
b1bcc784bb
2 changed files with 3 additions and 1 deletions
|
@ -99,6 +99,8 @@ class Dossier < ApplicationRecord
|
|||
has_many :prefilled_champs_public, -> { root.public_only.prefilled }, class_name: 'Champ', inverse_of: false
|
||||
|
||||
has_many :commentaires, inverse_of: :dossier, dependent: :destroy
|
||||
has_many :preloaded_commentaires, -> { includes(:dossier_correction, piece_jointe_attachment: :blob) }, class_name: 'Commentaire', inverse_of: :dossier
|
||||
|
||||
has_many :invites, dependent: :destroy
|
||||
has_many :follows, -> { active }, inverse_of: :dossier
|
||||
has_many :previous_follows, -> { inactive }, class_name: 'Follow', inverse_of: :dossier
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue