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, options)
  query.order(options[:order]) if options[:order]
  query.order(options[:desc_order], :desc) if options[:desc_order]
  query
end