other option for groupe instructeurs injection
This commit is contained in:
parent
08fb49d176
commit
1424fca469
5 changed files with 37 additions and 29 deletions
|
@ -8,7 +8,8 @@ class Column
|
|||
|
||||
TYPE_DE_CHAMP_TABLE = 'type_de_champ'
|
||||
|
||||
attr_reader :table, :column, :label, :type, :filterable, :displayable, :options_for_select
|
||||
attr_reader :table, :column, :label, :type, :filterable, :displayable
|
||||
attr_accessor :options_for_select
|
||||
|
||||
def initialize(procedure_id:, table:, column:, label: nil, type: :text, filterable: true, displayable: true, options_for_select: [])
|
||||
@procedure_id = procedure_id
|
||||
|
|
|
@ -83,12 +83,7 @@ module ColumnsConcern
|
|||
|
||||
private
|
||||
|
||||
def groupe_instructeurs_id_column
|
||||
groupes = Current.user&.instructeur&.groupe_instructeurs || []
|
||||
options_for_select = groupes.filter_map { [_1.label, _1.id] if _1.procedure_id == id }
|
||||
|
||||
dossier_col(table: 'groupe_instructeur', column: 'id', type: :enum, options_for_select:)
|
||||
end
|
||||
def groupe_instructeurs_id_column = dossier_col(table: 'groupe_instructeur', column: 'id', type: :enum)
|
||||
|
||||
def followers_instructeurs_email_column = dossier_col(table: 'followers_instructeurs', column: 'email')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue