-
-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graph like behaviour #5
Comments
I added following code snippet to my domain object: (i am new to ruby so may be this is not the best way) Although this seems alright with unit tests; when i test manually from browser; server dies due to infinite loop i guess. validate :validate_recycling def validate_recycling def check_recycling(parents) |
@yamanyar - I think you got confused with |
Yes you are right; I was asked to post my question to here and I didn't check that this repository was for acts-as_tree. Sorry for the wrong post |
I can store a relation that is a graph in fact. Is it expected? I think it should throw an exception when there is a recycling path (For example A->B->A->B....). Here is the test (please note that this test passes; however i am expecting it to fail):
category = Category.new
category.name="Parent"
category.save
child = category.children.create("name" => "child_1")
child.children = [category]
assert category.save
loadedChild = Category.find_by_name("child_1")
assert_equal "Parent", loadedChild.parent.name
assert_equal "Parent", loadedChild.children[0].name
The text was updated successfully, but these errors were encountered: