chore: only create columns on fillable champs

This commit is contained in:
Paul Chavard 2024-10-30 14:28:23 +01:00
parent 10e3faec92
commit e2ace4f6bd
No known key found for this signature in database

View file

@ -93,17 +93,21 @@ class TypesDeChamp::TypeDeChampBase
end
def columns(procedure_id:, displayable: true, prefix: nil)
[
Column.new(
procedure_id:,
table: Column::TYPE_DE_CHAMP_TABLE,
column: stable_id.to_s,
label: libelle_with_prefix(prefix),
type: TypeDeChamp.column_type(type_champ),
value_column: TypeDeChamp.value_column(type_champ),
displayable:
)
]
if fillable?
[
Column.new(
procedure_id:,
table: Column::TYPE_DE_CHAMP_TABLE,
column: stable_id.to_s,
label: libelle_with_prefix(prefix),
type: TypeDeChamp.column_type(type_champ),
value_column: TypeDeChamp.value_column(type_champ),
displayable:
)
]
else
[]
end
end
private