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
-
#mandatory_columns ⇒ Array<Datagrid::Columns::Column>
Returns a list of enabled columns with mandatory: true option If no mandatory columns specified than all of them considered mandatory.
-
#optional_columns ⇒ Array<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.
Instance Method Details
#mandatory_columns ⇒ Array<Datagrid::Columns::Column>
Returns a list of enabled columns with mandatory: true option If no mandatory columns specified than all of them considered mandatory
49 50 51 |
# File 'lib/datagrid/column_names_attribute.rb', line 49 def mandatory_columns available_columns.select(&:mandatory?) end |
#optional_columns ⇒ Array<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
56 57 58 |
# File 'lib/datagrid/column_names_attribute.rb', line 56 def optional_columns available_columns - mandatory_columns end |