lib/fertile_forest/modules/finders.rb
#
# Find grandchild nodes from base node.
#
# @param base_obj [Entity|Integer] Base node|id to find.
# @param columns [Array] Columns for SELECT clause.
# @return [ActiveRecord::Relation] Basic query for finding grandchild nodes.
# @return [nil] No grandchild nodes.
#
Find grandchild nodes from base node.
Find grandchild nodes from base node .
def grandchildren(base_obj, columns = nil)
            base_node = ff_resolve_nodes(base_obj)
            return [] if base_node.blank?
            grand_number = 2
            subtree(
                base_node,
                grand_number,
                SUBTREE_WITHOUT_TOP_NODE,
                columns
              )
              .where(@_ff_depth => base_node.ff_depth + grand_number)
          end
def grandchildren ( base_obj , columns = nil ) base_node = ff_resolve_nodes ( base_obj ) return [ ] if base_node . blank? grand_number = 2 subtree ( base_node , grand_number , SUBTREE_WITHOUT_TOP_NODE , columns ) . where ( @_ff_depth => base_node . ff_depth + grand_number ) end
Find grandchild nodes from base node.
Find grandchild nodes from base node .
# return value
Basic query for finding grandchild nodes.
Basic query for finding grandchild nodes .
ActiveRecord::Relation
No grandchild nodes.
No grandchild nodes .
nil
base_obj
Base node|id to find.
Base node|id to find .
columns
Columns for SELECT clause.
Columns for SELECT clause .