DEV Community

Discussion on: Why is Rails ActiveRelation.update_all updating a different set of records?

 
andy profile image
Andy Zhao (he/him)

The Ancestry gem. It's what we (dev.to) use for the comment tree.

Thread Thread
 
andy profile image
Andy Zhao (he/him)

@acflint running .or gives me an error since the built in subtree and ancestors methods have some extra SQL in there. :(

comment.subtree.or(c.ancestors)
#=> ArgumentError: Relation passed to #or must be
#=> structurally compatible. Incompatible values:
#=> [:order, :reordering]