lib/active_record/hierarchical_query/query.rb
# Specify which columns should be selected in addition to primary key,
# CONNECT BY columns and ORDER SIBLINGS columns.
#
# @param [Array<Symbol, String, Arel::Attributes::Attribute, Arel::Nodes::Node>] columns
# @option columns [true, false] :start_with include given columns to START WITH clause (true by default)
# @return [ActiveRecord::HierarchicalQuery::Query] self
Specify which columns should be selected in addition to primary key,
CONNECT BY columns and ORDER SIBLINGS columns.
Specify which columns should be selected in addition to primary key CONNECT BY columns and ORDER SIBLINGS columns .
def select(*columns)
        options = columns.extract_options!
        columns = columns.flatten.map do |column|
          column.is_a?(Symbol) ? table[column] : column
        end
        if options.fetch(:start_with, true)
          start_with { |scope| scope.select(columns) }
        end
        @child_scope_value = @child_scope_value.select(columns)
        self
      end
def select ( * columns ) options = columns . extract_options! columns = columns . flatten . map do | column | column . is_a? ( Symbol ) ? table [ column ] : column end if options . fetch ( :start_with , true ) start_with { | scope | scope . select ( columns ) } end @child_scope_value = @child_scope_value . select ( columns ) self end
Specify which columns should be selected in addition to primary key,
CONNECT BY columns and ORDER SIBLINGS columns.
Specify which columns should be selected in addition to primary key CONNECT BY columns and ORDER SIBLINGS columns .
# TODO: detect if column already present in START WITH clause and skip it
None
ActiveRecord::HierarchicalQuery::Query
columns
:start_with include given columns to START WITH clause (true by default)
: start_with include given columns to START WITH clause ( true by default )
<not_specific>
None