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_get_previous_node(base_node)
            return nil if base_node.blank?
            ffqq = arel_table[@_ff_queue]
            ff_usual_conditions_scope(base_node.ff_grove)
                .where(ffqq.lt(base_node.ff_queue))
                .ff_usual_order_scope(true)
                .ff_required_columns_scope()
                .first
          end
def ff_get_previous_node ( base_node ) return nil if base_node . blank? ffqq = arel_table [ @_ff_queue ] ff_usual_conditions_scope ( base_node . ff_grove ) . where ( ffqq . lt ( base_node . ff_queue ) ) . ff_usual_order_scope ( true ) . ff_required_columns_scope ( ) . first end
Find trunk (= ancestor) nodes from base node in ordered range.
Find trunk ( = ancestor ) nodes from base node in ordered range .
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 .