Gestionnaire procedures though administrateur and dossiers through procedures

This commit is contained in:
Xavier J 2015-11-16 18:08:19 +01:00
parent de356ae0ab
commit 3effa5e9fd
2 changed files with 5 additions and 0 deletions

View file

@ -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

View file

@ -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