models: fix ProcedurePresentation#sorted_ids
The `Dossier#with_notifications` scope needs to be composed with an `instructeurs` scope. But it seems Rails 6 will only generate proper SQL if the `instructeurs` scope is merged before filtering on `with_notifications`.
This commit is contained in:
parent
2f7fbc8474
commit
cd65dc14dd
1 changed files with 1 additions and 1 deletions
|
@ -79,7 +79,7 @@ class ProcedurePresentation < ApplicationRecord
|
|||
|
||||
case table
|
||||
when 'notifications'
|
||||
dossiers_id_with_notification = dossiers.with_notifications.merge(instructeur.followed_dossiers).ids
|
||||
dossiers_id_with_notification = dossiers.merge(instructeur.followed_dossiers).with_notifications.ids
|
||||
if order == 'desc'
|
||||
return dossiers_id_with_notification +
|
||||
(dossiers.order('dossiers.updated_at desc').ids - dossiers_id_with_notification)
|
||||
|
|
Loading…
Reference in a new issue