Method: Effective::Resources::Sql#sort_column
- Defined in:
- app/models/effective/resources/sql.rb
#sort_column ⇒ Object
This tries to figure out the column we should order this collection by. Whatever would match up with the .to_s Unless it’s set from outside by datatables…
79 80 81 82 83 84 85 86 87 |
# File 'app/models/effective/resources/sql.rb', line 79 def sort_column return @_sort_column if @_sort_column ['name', 'title', 'label', 'subject', 'full_name', 'first_name', 'email', 'number', 'description'].each do |name| return name if column_names.include?(name) end klass.primary_key end |