modify models
This commit is contained in:
parent
a94568e2ef
commit
0f968f4c4e
2 changed files with 6 additions and 2 deletions
|
@ -815,6 +815,10 @@ class Dossier < ApplicationRecord
|
||||||
restore_dossier_and_destroy_deleted_dossier(author)
|
restore_dossier_and_destroy_deleted_dossier(author)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elsif author_is_administration(author) && hidden_by_administration?
|
||||||
|
transaction do
|
||||||
|
update(hidden_by_administration_at: nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,8 @@ class Instructeur < ApplicationRecord
|
||||||
COUNT(DISTINCT dossiers.id) FILTER (where not archived AND dossiers.state in ('en_construction', 'en_instruction') AND follows.instructeur_id = :instructeur_id) AS suivis,
|
COUNT(DISTINCT dossiers.id) FILTER (where not archived AND dossiers.state in ('en_construction', 'en_instruction') AND follows.instructeur_id = :instructeur_id) AS suivis,
|
||||||
COUNT(DISTINCT dossiers.id) FILTER (where not archived AND dossiers.state in ('accepte', 'refuse', 'sans_suite')) AS traites,
|
COUNT(DISTINCT dossiers.id) FILTER (where not archived AND dossiers.state in ('accepte', 'refuse', 'sans_suite')) AS traites,
|
||||||
COUNT(DISTINCT dossiers.id) FILTER (where not archived AND NOT (dossiers.hidden_by_user_at IS NOT NULL AND state = 'en_construction')) AS tous,
|
COUNT(DISTINCT dossiers.id) FILTER (where not archived AND NOT (dossiers.hidden_by_user_at IS NOT NULL AND state = 'en_construction')) AS tous,
|
||||||
COUNT(DISTINCT dossiers.id) FILTER (where archived) AS archives,
|
COUNT(DISTINCT dossiers.id) FILTER (where not archived AND (dossiers.hidden_by_administration_at IS NOT NULL AND dossiers.state in ('accepte', 'refuse', 'sans_suite') )) AS supprimes_recemment,
|
||||||
|
COUNT(DISTINCT dossiers.id) FILTER (where archived) AS archives,
|
||||||
COUNT(DISTINCT dossiers.id) FILTER (where
|
COUNT(DISTINCT dossiers.id) FILTER (where
|
||||||
procedures.procedure_expires_when_termine_enabled
|
procedures.procedure_expires_when_termine_enabled
|
||||||
AND (
|
AND (
|
||||||
|
@ -256,7 +257,6 @@ class Instructeur < ApplicationRecord
|
||||||
ON follows.dossier_id = dossiers.id
|
ON follows.dossier_id = dossiers.id
|
||||||
AND follows.unfollowed_at IS NULL
|
AND follows.unfollowed_at IS NULL
|
||||||
WHERE "dossiers"."hidden_at" IS NULL
|
WHERE "dossiers"."hidden_at" IS NULL
|
||||||
AND "dossiers"."hidden_by_administration_at" IS NULL
|
|
||||||
AND "dossiers"."state" != 'brouillon'
|
AND "dossiers"."state" != 'brouillon'
|
||||||
AND "dossiers"."groupe_instructeur_id" in (:groupe_instructeur_ids)
|
AND "dossiers"."groupe_instructeur_id" in (:groupe_instructeur_ids)
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Add table
Reference in a new issue