acts_as_recursive_tree
acts_as_recursive_tree copied to clipboard
Integrate into Rails scopes
The descendants/descendants_of methods are instance/class methods, which cannot be use when using scopes. Find a way to allow things like
Node.where(foo: 'bar').descendants
instead of
Node.descendants_of(Node.where(foo: 'bar'))
When this feature is implemented add a deprecation warning to switch over to new usage when an argument is passed to the class methods.
Solution found:
Using current_scope
method of AR we can access the current relation when calling the method.