# File sort_helper.rb, line 101
  def self.sort(a, b, params)
    if /\d/ === params['sort']
      params['sort'].split
    else
      @@default_columns
    end.each do |column_index|
      column_index = column_index.to_i
      next if column_index.abs >= @@sort_columns.size
      a_col = a
      b_col = b
      @@sort_columns[column_index.abs].split('.').each do |meth|
        a_col = a_col.send(meth)
        b_col = b_col.send(meth)
      end
      reverse = (column_index < 0)
      case a_col && a_col <=> b_col
      when -1
        return reverse ? 1 : -1
      when 1, nil  # nil < anything else
        return reverse ? -1 : 1
      end
    end
    0
  end