diff --git a/app/models/gestionnaire.rb b/app/models/gestionnaire.rb index fa2a0e669..1c94f5070 100644 --- a/app/models/gestionnaire.rb +++ b/app/models/gestionnaire.rb @@ -93,11 +93,7 @@ class Gestionnaire < ApplicationRecord .find_by(gestionnaire: self, dossier: dossier) if follow.present? - champs_publiques = follow.dossier.champs.updated_since?(follow.demande_seen_at).any? - - pieces_justificatives = follow.dossier.pieces_justificatives.updated_since?(follow.demande_seen_at).any? - - demande = champs_publiques || pieces_justificatives + demande = follow.dossier.champs.updated_since?(follow.demande_seen_at).any? annotations_privees = follow.dossier.champs_private.updated_since?(follow.annotations_privees_seen_at).any? @@ -154,10 +150,6 @@ class Gestionnaire < ApplicationRecord .joins(:champs) .where('champs.updated_at > follows.demande_seen_at') - updated_pieces_justificatives = dossiers - .joins(:pieces_justificatives) - .where('pieces_justificatives.updated_at > follows.demande_seen_at') - updated_annotations = dossiers .joins(:champs_private) .where('champs.updated_at > follows.annotations_privees_seen_at') @@ -174,7 +166,6 @@ class Gestionnaire < ApplicationRecord [ updated_demandes, - updated_pieces_justificatives, updated_annotations, updated_avis, updated_messagerie diff --git a/spec/models/gestionnaire_spec.rb b/spec/models/gestionnaire_spec.rb index 86423c874..dade36049 100644 --- a/spec/models/gestionnaire_spec.rb +++ b/spec/models/gestionnaire_spec.rb @@ -251,12 +251,6 @@ describe Gestionnaire, type: :model do it { is_expected.to match({ demande: true, annotations_privees: false, avis: false, messagerie: false }) } end - context 'when there is a modification on a piece jusitificative' do - before { dossier.pieces_justificatives << create(:piece_justificative, :contrat) } - - it { is_expected.to match({ demande: true, annotations_privees: false, avis: false, messagerie: false }) } - end - context 'when there is a modification on private champs' do before { dossier.champs_private.first.update_attribute('value', 'toto') } @@ -326,12 +320,6 @@ describe Gestionnaire, type: :model do end end - context 'when there is a modification on a piece justificative' do - before { dossier.pieces_justificatives << create(:piece_justificative, :contrat) } - - it { is_expected.to match([dossier.id]) } - end - context 'when there is a modification on public champs on a followed dossier from another procedure' do before { dossier_on_procedure_2.champs.first.update_attribute('value', 'toto') }