# frozen_string_literal: true module ActsAsRecursiveTree module ActsMacro ## # Configuration options are: # # * foreign_key - specifies the column name to use for tracking # of the tree (default: +parent_id+) def recursive_tree(parent_key: :parent_id, parent_type_column: nil) class_attribute :_recursive_tree_config self._recursive_tree_config = Config.new( model_class: self, parent_key: parent_key.to_sym, parent_type_column: parent_type_column.try(:to_sym) ) include ActsAsRecursiveTree::Model include ActsAsRecursiveTree::Associations include ActsAsRecursiveTree::Scopes end alias acts_as_tree recursive_tree end end