Method: AdminAssistant::Index::RecordFinder#sort_column

Defined in:
lib/admin_assistant/index.rb

#sort_columnObject



166
167
168
169
170
171
172
173
174
# File 'lib/admin_assistant/index.rb', line 166

def sort_column
  if @index.sort
    @index.columns.detect { |c|
      c.name.to_s == @index.sort
    } || belongs_to_sort_column
  elsif settings.sort_by.is_a?(Symbol)
    @index.columns.detect { |c| c.name == settings.sort_by.to_s }
  end
end