Flowdock
method

reorder

Importance_1
v4.0.2 - Show latest stable - 0 notes - Class: ActiveRecord::QueryMethods
reorder(*args) public

Replaces any existing order defined on the relation with the specified order.

User.order('email DESC').reorder('id ASC') # generated SQL has 'ORDER BY id ASC'

Subsequent calls to order on the same relation will be appended. For example:

User.order('email DESC').reorder('id ASC').order('name ASC')

generates a query with ‘ORDER BY id ASC, name ASC’.

Show source
Register or log in to add new notes.