You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
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_recyclingdefvalidate_recyclingbegincheck_recycling[]rescueArgumentError=>msgerrors.add(:base,msg.message)endenddefcheck_recycling(parents)raiseArgumentError,"#{self.name} is recycling!"ifparents.include?(self)copy=parents.dupcopy.pushselfchildren.each{ |child| child.check_recycling(copy)}end
I guess the problem is before to validation, following lines (i found in the source code of the gem i installed) may run forever:
nodes << node=node.parentwhilenode.parent
The text was updated successfully, but these errors were encountered:
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):
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.
I guess the problem is before to validation, following lines (i found in the source code of the gem i installed) may run forever:
The text was updated successfully, but these errors were encountered: