manager: localize dossier enums

In the previous commit, we cleaned up the localization of the
Dossier.state enum. This prevented administrate from crashing, but now
the dossier enum are no longer localized in the Manager.

By using a `Field::Enum` type, we instruct the administrate plugin
to look up our localized name for the Dossier state enum.
This commit is contained in:
Pierre de La Morinerie 2021-05-06 10:29:52 +00:00
parent b8f71bd52c
commit b398485d97
3 changed files with 5 additions and 1 deletions

View file

@ -10,7 +10,7 @@ class DossierDashboard < Administrate::BaseDashboard
ATTRIBUTE_TYPES = {
id: Field::Number.with_options(searchable: true),
procedure: Field::HasOne,
state: Field::String,
state: Field::Enum,
user: Field::BelongsTo,
text_summary: Field::String.with_options(searchable: false),
created_at: Field::DateTime,