Module: Datagrid::ColumnNamesAttribute

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/datagrid/column_names_attribute.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#mandatory_columnsArray<Datagrid::Columns::Column>

Returns a list of enabled columns with mandatory: true option If no mandatory columns specified than all of them considered mandatory

Returns:



49
50
51
# File 'lib/datagrid/column_names_attribute.rb', line 49

def mandatory_columns
  available_columns.select(&:mandatory?)
end

#optional_columnsArray<Datagrid::Columns::Column>

Returns a list of enabled columns without mandatory: true option If no mandatory columns specified than all of them considered mandatory but not optional

Returns:



56
57
58
# File 'lib/datagrid/column_names_attribute.rb', line 56

def optional_columns
  available_columns - mandatory_columns
end