closure_tree
closure_tree copied to clipboard
Easily and efficiently make your ActiveRecord models support hierarchies
Hi, My project has an Article model which behaves as ordered tree supported by closure_tree. Recently when creating new models, it reports the following error, does anyone meet them before?...
Hi, I have page model with tree structure. I also have scope based on status: ```ruby class Page < ApplicationRecord has_closure_tree STATUSES = %w[draft published].freeze enum status: STATUSES scope :published,...
Hi there, Thanks for the awesome gem - it's exactly what I was looking for. I'm having an issue where I'm trying to add 200 child nodes and it's just...
Is there a way to get a flat version of a hash tree. It doesn't have to be a hash tree, but just be ordered in the same way, and...
> :touch delegates to the belongs_to annotation for the parent, so touching cascades to all children (the performance of this for deep trees isn't currently optimal). So, when a parent...
I'm using ```ruby Comment.where(commentable: find_commentable).includes(:children).includes(:commenter).limit(3) ``` To fetch comments, but the `.limit(3)` only limits the number of top level comments. How can I limit the depth, and how many children...
I'm currently migrating from awesome_nested_set to this beautiful gem and I noticed that `#root` for an entry returns nil until the record got saved even if a parent is set....
```ruby class Tag has_closure_tree dependent: :delete_all end ``` With the code above, `@tag.destroy` only deletes `@tag`'s direct children. Its grandchildren are all orphaned, keeping old `parent_id`s which no longer exist....
Closure tree looks great. I need to be able to report out on count (count the number of all descendents) and do some other summarization (summing points for the node...