Method: ActiveModel::Datastore::ClassMethods#query_sort
- Defined in:
- lib/active_model/datastore.rb
#query_sort(query, options) ⇒ Object
Adds sorting to the results by a property name if included in the options.
459 460 461 462 463 |
# File 'lib/active_model/datastore.rb', line 459 def query_sort(query, ) query.order([:order]) if [:order] query.order([:desc_order], :desc) if [:desc_order] query end |