Allow instructeur to have multiple agent_connect_information

AC will return two different sub depending of the domain demarches.gouv.fr or ds.
Both agent_connect_information are stored and the corresponding instructeur is found by its email.
We do not store anymore the agent_connect_id on the instructeur as the are many.
This commit is contained in:
simon lehericey 2024-03-19 14:57:19 +01:00
parent 2f6147308c
commit ca17524559
3 changed files with 36 additions and 11 deletions

View file

@ -1,8 +1,10 @@
class Instructeur < ApplicationRecord
self.ignored_columns += [:agent_connect_id]
include UserFindByConcern
has_and_belongs_to_many :administrateurs
has_one :agent_connect_information, dependent: :destroy
has_many :agent_connect_information, dependent: :destroy
has_many :assign_to, dependent: :destroy
has_many :groupe_instructeurs, -> { order(:label) }, through: :assign_to