Method: AdminAssistant::Index::RecordFinder#order_sql

Defined in:
lib/admin_assistant/index.rb

#order_sqlObject



130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/admin_assistant/index.rb', line 130

def order_sql
  if (sc = sort_column)
    first_part = if (by_assoc = belongs_to_sort_column)
      by_assoc.order_sql_field
    else
      sc.name
    end
    "#{first_part} #{@index.sort_order}"
  else
    settings.sort_by
  end
end