Just to finish this thread,
the problem is not within ruleby.
it is caused when changing associations on active record objects in
the rule book.
as soon as you move the associations children around the parent goes
stale.
thus, if active record associated objects are part of the facts that
get modified in the rule book, then those changes might not be picked
up by other rules in the way you would expect - which can of course
cause an infinate loop.
therefore reloading the parent of the association in the rule fixes
this behaviour.
to be on the safe side it is probably better to retract the object and
assert it with a find as such:
retract v[:parent_object]
assert Class.find(v[:parent_object])
This obviously results in some additional cost on the database side of
things - so I guess you have to ask yourself if it is better to load
the associations separately in to to the facts and use the rules
conditions to find them. I have opted to write use the association
parents only in the facts and reload them after manipulating them in
the rule book.
Jason.