Skip to content

SystemStackError when updating fixtures #424

Open
@wakairo

Description

@wakairo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions