lib/fertile_forest/modules/finders.rb
#
# Find trunk (= ancestor) nodes from base node in ordered range.
#
# @param base_obj [Entity|Integer] Base node|id to find.
# @param range [Integer] Ordered range of trunk nodes.
#   -1:To designate as root node.
# @param columns [Array] Columns for SELECT clause.
# @return [ActiveRecord::Relation] Basic query for finding trunk nodes.
# @return [nil] No trunk nodes.
#
Find trunk (= ancestor) nodes from base node in ordered range.
Find trunk ( = ancestor ) nodes from base node in ordered range .
def ff_create_boundary_queue_subquery(base_node)
            ffqq = arel_table[@_ff_queue]
            ffdd = arel_table[@_ff_depth]
            ff_usual_projection(base_node.ff_grove)
                .project(ffqq.minimum.as('boundary_queue'))
                .where(ffdd.lteq(base_node.ff_depth))
                .where(ffqq.gt  (base_node.ff_queue))
          end
def ff_create_boundary_queue_subquery ( base_node ) ffqq = arel_table [ @_ff_queue ] ffdd = arel_table [ @_ff_depth ] ff_usual_projection ( base_node . ff_grove ) . project ( ffqq . minimum . as ( 'boundary_queue' ) ) . where ( ffdd . lteq ( base_node . ff_depth ) ) . where ( ffqq . gt ( base_node . ff_queue ) ) end
Find trunk (= ancestor) nodes from base node in ordered range.
Find trunk ( = ancestor ) nodes from base node in ordered range .
# same depth can be boundary node, therefore use LTE(<=)
Basic query for finding trunk nodes.
Basic query for finding trunk nodes .
ActiveRecord::Relation
No trunk nodes.
No trunk nodes .
nil
base_node
<not_specific>
base_obj
<not_specific>
Base node|id to find.
Base node|id to find .
range
<not_specific>
Ordered range of trunk nodes. -1:To designate as root node.
Ordered range of trunk nodes . - 1 : To designate as root node .
columns
<not_specific>
Columns for SELECT clause.
Columns for SELECT clause .