Closed LucienMLD closed 3 months ago
Scrcipt pour trouver les experts apparement inutiles
single_member = Expert.unscoped.joins(:users)
.merge(User.unscoped.not_deleted)
.group(:id)
.having("COUNT(users.id)=1")
experts = Expert.joins(:users)
.where(id: single_member)
.where("users.email = experts.email")
.without_subjects
.without_custom_communes
⚠ à faire une fois https://github.com/betagouv/conseillers-entreprises/pull/3521 mergé et en prod