Module SymetrieCom::Acts::NestedSet::ClassMethods
In: lib/symetrie_com/acts_as_better_nested_set.rb

This module provides an enhanced acts_as_nested_set mixin for ActiveRecord. Please see the README for background information, examples, and tips on usage.

Methods

Classes and Modules

Module SymetrieCom::Acts::NestedSet::ClassMethods::SingletonMethods

Public Instance methods

Configuration options are:

  • dependent - behaviour for cascading destroy operations (default: :delete_all)
  • parent_column - Column name for the parent/child foreign key (default: parent_id).
  • left_column - Column name for the left index (default: lft).
  • right_column - Column name for the right index (default: rgt). NOTE: Don‘t use left and right, since these are reserved database words.
  • scope - Restricts what is to be considered a tree. Given a symbol, it‘ll attach "_id" (if it isn‘t there already) and use that as the foreign key restriction. It‘s also possible to give it an entire string that is interpolated if you need a tighter scope than just a foreign key. Example: acts_as_nested_set :scope => ‘tree_id = #{tree_id} AND completed = 0‘
  • text_column - Column name for the title field (optional). Used as default in the {your-class}_options_for_select helper method. If empty, will use the first string field of your model class.

[Validate]