def sort_array
      if @data.sorted_by
        @data.sorted_by.inject([]) do |memo, (key, value)|
          memo << [@data.columns.index(key), value == 'descending' ? 1 : 0]
        end
      end
    end
def sort_array
      if @data.sorted_by
        @data.sorted_by.inject([]) do |memo, (key, value)|
          memo << [@data.columns.index(key), value == 'descending' ? 1 : 0]
        end
      end
    end
A convienence method to return the sort array for table setter.