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

Methods

Public Instance methods

Hook that prevents a second root from being created.

[Source]

     # File lib/sequel/plugins/tree.rb, line 146
146:           def before_save
147:             if possible_root? && (root = model.root) && pk != root.pk
148:               raise TreeMultipleRootError, "there is already a root #{model.name} defined"
149:             end
150:             super
151:           end

[Validate]