Pierre de La Morinerie
087e438eb6
models: delete AdministrateursInstructeur when destroying Instructeur
...
By default, `has_and_belongs_to_many` properly deletes the record in
the join table.
However, as the association is declared manually with a
`has_many / through`, it doesn't delete the joined record automatically.
As we also lack a foreign-key contraint on the join table, that means
a dangling record remains in the join table.
To fix this, let's declare it a proper `has_and_belongs_to_many`
association, which will let the join record be deleted automatically
on destroy.
2022-03-02 11:26:53 +01:00
Kara Diaby
a6b2873bfc
modify instructeur model
2022-02-09 14:43:36 +01:00
Kara Diaby
0f968f4c4e
modify models
2022-01-27 17:01:27 +01:00
Kara Diaby
0e3532a0b2
Fixe la liste 'tous' des dossiers instructeurs lorsqu'un dossier est en constructino et caché par l'usager
2022-01-24 16:47:47 +01:00
Kara Diaby
e2caf5718f
modify instructeur model
2022-01-12 15:49:38 +01:00
Kara Diaby
1ca553e088
rename hidden_by_instructeur by hidden_by_administration
2022-01-03 11:51:25 +01:00
Kara Diaby
22ac853815
add hidden_by_instructeur scope
2021-12-29 17:37:58 +01:00
Paul Chavard
4e779f445d
fix(instructeur): copy notifications settings from previous groupe instructeur
...
fix #6763
2021-12-23 13:55:25 +01:00
Martin
2dfbc70d41
feat(instructeur#dossiers_count_summary): add counter for expirants. ignore brouillon
2021-12-06 07:05:17 +01:00
simon lehericey
1926a630f9
add agent_connect_id to instructeur
2021-11-23 14:17:59 +01:00
Paul Chavard
c4b93f8d4a
fix(groupe_instructeur): unfollow dossiers when removed from groupe instructeur
2021-10-28 14:45:52 +02:00
simon lehericey
7c65571fca
add case when the old_expert or old_instructeur is nil
2021-10-12 11:04:06 +02:00
simon lehericey
d7e621d167
beef up the merge methods
2021-10-07 15:51:31 +02:00
simon lehericey
136f29524e
merge instructeur
2021-10-07 15:51:31 +02:00
simon lehericey
1000417bc9
update notifications_for_dossier used in dossier show
2021-10-05 12:05:43 +02:00
Paul Chavard
8b4bef2816
refactor(routage): simplify goupe_instructeur assign code
2021-09-18 11:21:26 +02:00
kara Diaby
c92b249340
fixup! modify models
2021-07-27 19:38:21 +02:00
Christophe Robillard
f40d96fbd2
Revert "Revert "Export de tous les dossier d'une démarche""
...
This reverts commit d9a588b52e
.
2021-04-29 17:29:47 +02:00
krichtof
d9a588b52e
Revert "Export de tous les dossier d'une démarche"
2021-04-29 16:07:18 +02:00
simon lehericey
db23a853a9
fetch all notification at once
2021-04-29 11:23:41 +02:00
Christophe Robillard
c25f3c79d9
add archive model
2021-04-28 11:40:58 +02:00
simon lehericey
cd6cb99c3c
add bypass_email_login_token to instructeur
2021-04-13 09:43:38 +02:00
simon lehericey
430acb1cb0
Fetch all count at once (- 400ms on pass culture)
2021-04-13 09:32:48 +02:00
kara Diaby
2930de1015
remove useless code in models
2021-03-24 17:47:24 +01:00
clemkeirua
f96377d878
refactor Dossier#with_notifications
2020-09-21 08:28:42 +00:00
simon lehericey
e4de522b48
only retrieve id of procedures with notifications
2020-09-11 09:43:04 +00:00
clemkeirua
c7b96d3d43
add feature-flip for instructeurs on cached notifications
2020-09-08 15:40:42 +00:00
Pierre de La Morinerie
6d28069539
models: generate annotations
2020-08-12 11:45:53 +02:00
Christophe Robillard
a072d35211
use traitement model
...
when a dossier is terminated (accepte, refuse or classe_sans_suite),
we store now `processed_at` and `motivation` in a traitement instance
2020-07-08 18:15:15 +02:00
Christophe Robillard
f683b850c3
Notifie instructeurs le souhaitant lors depot dossier
...
Notifie par mail uniquement les instructeurs qui le souhaitent à chaque dépôt de dossier
2020-04-09 15:02:05 +02:00
Christophe Robillard
969478b706
Envoie une notif aux followers_instructeurs le souhaitant
...
après chaque message déposé par l'usager
2020-04-09 14:17:07 +02:00
Paul Chavard
c763679b54
Remove non-existant columns from manager dashboards
2020-03-26 16:17:07 +01:00
kara Diaby
eb8df80c18
fix the email notifications data bug
2020-03-20 16:38:57 +01:00
kara Diaby
395af2fbb0
instructors : receive daily emails for declarative folders
2020-03-17 15:54:50 +01:00
Paul Chavard
3cd4597006
Update rubocop roules
2020-03-17 11:25:21 +01:00
Christophe Robillard
50007b2aac
highlight demande tab when groupe instructeur updated
2020-03-04 14:56:59 +01:00
Christophe Robillard
9f7b78ff8b
supprime les colonnes ignorées
2020-02-17 19:03:43 +01:00
Christophe Robillard
6e0d1eaee3
remove email ignored column for admin and instructeur
2020-02-17 15:01:40 +01:00
kara Diaby
0b8a59d5e9
Add the possibility to disable weekly email notifications (instructeur) && rename the column email_notifications_enabled to daily_email_notification_enabled
2020-02-12 13:02:31 +00:00
Christophe Robillard
cee4c5b8fb
Revert "Revert "4127 fix superadmin supprime compte usager""
...
This reverts commit 751f24f7bb
.
2020-02-04 16:07:01 +01:00
Pierre de La Morinerie
751f24f7bb
Revert "4127 fix superadmin supprime compte usager"
2020-01-21 18:57:54 +01:00
Christophe Robillard
a6d007dbd3
supprime un instructeur
2020-01-21 15:05:33 +01:00
clemkeirua
7e15c6a4a4
add filtering by group in procedure_overview
...
The weekly overview do not work for instructeurs in procedures with multiples groups ;
they see dossiers that they do not have access to. Now the correct filter is added
2020-01-20 14:23:19 +01:00
Pierre de La Morinerie
2e8d365b93
instructeurs: disable the email column
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
f8358b3ae9
instructeurs: create without providing the email
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
8b8213c301
instructeurs: always eager load the user relationship
...
Now that `Instructeur.email` is merely an alias to `instructeur.user.email`,
and we changed every occurence of `instructeurs.pluck(:email)` to
`instructeurs.map(&:email)`, the new version using `map` may cause N+1 queries
if the users have not been preloaded.
It makes sense to always preload the user when fetching an Instructeur:
- Instructeur and User have a strongly coupled relationship
- It avoids N+1 queries everywhere in the app
Of course fetching an instructeur without needing its user will now do an
unecessary fetch of the associated user. But it seems better than leaving
a risk of N+1 queries in many places.
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
a462edb9bc
instructeurs: alias instructeur.email
...
This also means we need to replace instances of `pluck` on the email
column.
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
cd478b489e
instructeurs: replace calls to Instructeur.find_by(email: …)
2019-11-04 10:44:23 +01:00
simon lehericey
4febf1851f
notifications_for_procedure is now based on instructeur.groupe_instructeurs
2019-10-25 09:42:17 +02:00
Nicolas Bouilleaud
03c950ea97
Move followed_dossiers_with_notifications to a Dossier scope
...
Instead of instructeur.followed_dossiers_with_notifications, we can now write instructeur.followed_dossiers.with_notifications.
Yay composition!
2019-09-25 14:10:00 +02:00