lib/active_record/hierarchical_query/query.rb
# Specifies hierarchical order of the recursive query results.
#
# @example
#   MyModel.join_recursive do |hierarchy|
#     hierarchy.connect_by(id: :parent_id)
#              .order_siblings(:name)
#   end
#
# @example
#   MyModel.join_recursive do |hierarchy|
#     hierarchy.connect_by(id: :parent_id)
#              .order_siblings('name DESC, created_at ASC')
#   end
#
# @param [<Symbol, String, Arel::Nodes::Node, Arel::Attributes::Attribute>] columns
# @return [ActiveRecord::HierarchicalQuery::Query] self
Specifies hierarchical order of the recursive query results.
Specifies hierarchical order of the recursive query results .
def order_siblings(*columns)
        @order_values += columns
        self
      end
def order_siblings ( * columns ) @order_values += columns self end
Specifies hierarchical order of the recursive query results.
Specifies hierarchical order of the recursive query results .
None
ActiveRecord::HierarchicalQuery::Query
columns
<not_specific>
<not_specific>
None
example
MyModel.join_recursive do |hierarchy| hierarchy.connect_by(id: :parent_id) .order_siblings(:name) end
MyModel . join_recursive do |hierarchy| hierarchy . connect_by ( id : : parent_id ) . order_siblings ( : name ) end
example
MyModel.join_recursive do |hierarchy| hierarchy.connect_by(id: :parent_id) .order_siblings('name DESC, created_at ASC') end
MyModel . join_recursive do |hierarchy| hierarchy . connect_by ( id : : parent_id ) . order_siblings ( ' name DESC created_at ASC ' ) end