elight/acts_as_commentable_with_threading — pull request #32 by niklas (2012-07-17 16:45:56+00:00)
Title: order comment threads explicitly and only fetch root comments

We had a problem in our app: Destroying a commentable record did invoke all the :destroy hooks by the `has_many :comment_threads` but under certian circumstances it tried to load records it already deleted before. My first guess was the undeterministic order of deletion, but even then it happened.

My seconds guess aimed towards the tree structure. If awesome_nested_set cares about deletion of descendents, `:comment_threads` only has to return its `roots` and let `ans` work from there.

So here it is, works OK for us :)