Module: Datagrid::ColumnNamesAttribute
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/datagrid/column_names_attribute.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#columns(*args) ⇒ Object
:nodoc:.
-
#mandatory_columns ⇒ Object
Returns a list of enabled columns with
:mandatory => true
option If no mandatory columns specified than all of them considered mandatory. -
#optional_columns ⇒ Object
Returns a list of enabled columns without
:mandatory => true
option.
Instance Method Details
#columns(*args) ⇒ Object
:nodoc:
38 39 40 41 42 43 |
# File 'lib/datagrid/column_names_attribute.rb', line 38 def columns(*args) #:nodoc: = args. column_names = selected_column_names(*args) column_names << super(*column_names) end |
#mandatory_columns ⇒ Object
Returns a list of enabled columns with :mandatory => true
option If no mandatory columns specified than all of them considered mandatory
47 48 49 |
# File 'lib/datagrid/column_names_attribute.rb', line 47 def mandatory_columns available_columns.select {|c| c.mandatory? } end |
#optional_columns ⇒ Object
Returns a list of enabled columns without :mandatory => true
option
52 53 54 |
# File 'lib/datagrid/column_names_attribute.rb', line 52 def optional_columns available_columns - mandatory_columns end |