def acts_as_nested_interval(options = {})
      # Refactored
      cattr_accessor :nested_interval

      self.nested_interval = Configuration.new( self, **options )

      if self.table_exists? # Fix problem with migrating without table
        include ActsAsNestedInterval::Calculate
        include ActsAsNestedInterval::Moving
        include ActsAsNestedInterval::InstanceMethods
        include ActsAsNestedInterval::Callbacks
        include ActsAsNestedInterval::Associations
        extend ActsAsNestedInterval::ClassMethods
      end

      calculate(*([:lft, :rgt, :rgtq, :rgtp] & self.columns.map {|c| c.name.to_sym }))
    end
def acts_as_nested_interval(options = {})
      # Refactored
      cattr_accessor :nested_interval

      self.nested_interval = Configuration.new( self, **options )

      if self.table_exists? # Fix problem with migrating without table
        include ActsAsNestedInterval::Calculate
        include ActsAsNestedInterval::Moving
        include ActsAsNestedInterval::InstanceMethods
        include ActsAsNestedInterval::Callbacks
        include ActsAsNestedInterval::Associations
        extend ActsAsNestedInterval::ClassMethods
      end

      calculate(*([:lft, :rgt, :rgtq, :rgtp] & self.columns.map {|c| c.name.to_sym }))
    end
The +options+ hash can include:
 * <tt>:foreign_key</tt> -- the self-reference foreign key column name (default :parent_id).
 * <tt>:scope_columns</tt> -- an array of columns to scope independent trees.
 * <tt>:lft_index</tt> -- whether to use functional index for lft (default false).
 * <tt>:virtual_root</tt> -- whether to compute root's interval as in an upper root (default false)
 * <tt>:dependent</tt> -- dependency between the parent node and children nodes (default :restrict)