Module: Datagrid::ColumnNamesAttribute

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

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#columns(*args, **options) ⇒ Object

:nodoc:


40
41
42
# File 'lib/datagrid/column_names_attribute.rb', line 40

def columns(*args, **options) #:nodoc:
  super(*selected_column_names(*args), **options)
end

#mandatory_columnsObject

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


46
47
48
# File 'lib/datagrid/column_names_attribute.rb', line 46

def mandatory_columns
  available_columns.select {|c| c.mandatory? }
end

#optional_columnsObject

Returns a list of enabled columns without :mandatory => true option


51
52
53
# File 'lib/datagrid/column_names_attribute.rb', line 51

def optional_columns
  available_columns - mandatory_columns
end