In rails test, the following test code causes an error: SystemStackError: stack level too deep.
node = nodes(:one)
node.update(parent_id: node.id)
Node (class of the node) has closure tree as below.
class Node < ApplicationRecord
has_closure_tree
end
It seems that the following conditions are needed to reproduce this error:
- The node object is made from fixtures.
- Updating parent_id of the node to an id of self or descendants.
I have made a repository for this issue. To reproduce this error on this repository, please execute rails test command.
Repository: https://github.com/wakairo/issue-closure_tree-error_on_update
In
rails test, the following test code causes an error:SystemStackError: stack level too deep.Node (class of the node) has closure tree as below.
It seems that the following conditions are needed to reproduce this error:
I have made a repository for this issue. To reproduce this error on this repository, please execute
rails testcommand.Repository: https://github.com/wakairo/issue-closure_tree-error_on_update