Module | Sequel::Plugins::Tree::SingleRoot::InstanceMethods
In: | lib/sequel/plugins/tree.rb

### Methods

before_save

### Public Instance methods

before_save()

Hook that prevents a second root from being created.

[Source]

         # File lib/sequel/plugins/tree.rb, line 138
    138:           def before_save
    139:             if self[model.parent_column].nil? && (root = model.root) && pk != root.pk
    140:               raise TreeMultipleRootError, "there is already a root #{model.name} defined"
    141:             end
    142:             super
    143:           end

[Validate]