[#2486] followers_gestionnaires should not be a method

To help activerecord caching
This commit is contained in:
Frederic Merizen 2018-08-30 12:25:21 +02:00
parent 37c45f0d29
commit 9403d4c042

View file

@ -27,6 +27,7 @@ class Dossier < ApplicationRecord
has_many :invites_user, class_name: 'InviteUser', dependent: :destroy
has_many :invites_gestionnaires, class_name: 'InviteGestionnaire', dependent: :destroy
has_many :follows
has_many :followers_gestionnaires, through: :follows, source: :gestionnaire
has_many :avis, dependent: :destroy
belongs_to :procedure
@ -151,10 +152,6 @@ class Dossier < ApplicationRecord
end
end
def followers_gestionnaires
follows.includes(:gestionnaire).map(&:gestionnaire)
end
def reset!
etablissement.destroy