diff --git a/app/models/gestionnaire.rb b/app/models/gestionnaire.rb index 6b93b0538..4ff6638cd 100644 --- a/app/models/gestionnaire.rb +++ b/app/models/gestionnaire.rb @@ -5,4 +5,7 @@ class Gestionnaire < ActiveRecord::Base :recoverable, :rememberable, :trackable, :validatable belongs_to :administrateur + + has_many :procedures, through: :administrateur + has_many :dossiers, through: :procedures end diff --git a/spec/models/gestionnaire_spec.rb b/spec/models/gestionnaire_spec.rb index 2913c3cd3..cee2de33d 100644 --- a/spec/models/gestionnaire_spec.rb +++ b/spec/models/gestionnaire_spec.rb @@ -18,5 +18,7 @@ describe Gestionnaire, type: :model do describe 'association' do it { is_expected.to belong_to(:administrateur) } + it { is_expected.to have_many(:procedures) } + it { is_expected.to have_many(:dossiers) } end end