default default_displayed_column
This commit is contained in:
parent
0a54db6db5
commit
14483270ba
2 changed files with 9 additions and 1 deletions
|
@ -73,11 +73,17 @@ module ColumnsConcern
|
||||||
SortedColumn.new(column: notifications_column, order: 'desc')
|
SortedColumn.new(column: notifications_column, order: 'desc')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def default_displayed_columns = [email_column]
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def email_column
|
||||||
|
Column.new(procedure_id: id, table: 'user', column: 'email')
|
||||||
|
end
|
||||||
|
|
||||||
def standard_columns
|
def standard_columns
|
||||||
[
|
[
|
||||||
Column.new(procedure_id: id, table: 'user', column: 'email'),
|
email_column,
|
||||||
Column.new(procedure_id: id, table: 'followers_instructeurs', column: 'email'),
|
Column.new(procedure_id: id, table: 'followers_instructeurs', column: 'email'),
|
||||||
Column.new(procedure_id: id, table: 'groupe_instructeur', column: 'id', type: :enum),
|
Column.new(procedure_id: id, table: 'groupe_instructeur', column: 'id', type: :enum),
|
||||||
Column.new(procedure_id: id, table: 'avis', column: 'question_answer', filterable: false) # not filterable ?
|
Column.new(procedure_id: id, table: 'avis', column: 'question_answer', filterable: false) # not filterable ?
|
||||||
|
|
|
@ -27,6 +27,8 @@ class ProcedurePresentation < ApplicationRecord
|
||||||
attribute :expirant_filters, :filtered_column, array: true
|
attribute :expirant_filters, :filtered_column, array: true
|
||||||
attribute :archives_filters, :filtered_column, array: true
|
attribute :archives_filters, :filtered_column, array: true
|
||||||
|
|
||||||
|
before_create { self.displayed_columns = procedure.default_displayed_columns }
|
||||||
|
|
||||||
validates_associated :a_suivre_filters, :suivis_filters, :traites_filters,
|
validates_associated :a_suivre_filters, :suivis_filters, :traites_filters,
|
||||||
:tous_filters, :supprimes_filters, :expirant_filters, :archives_filters
|
:tous_filters, :supprimes_filters, :expirant_filters, :archives_filters
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue