closure_tree icon indicating copy to clipboard operation
closure_tree copied to clipboard

Easily and efficiently make your ActiveRecord models support hierarchies

Results 102 closure_tree issues
Sort by recently updated
recently updated
newest added

It will be also good to add besides moving nodes around to other parents the ability to copy node of tree with descendants. I wrote a temporary solution, but to...

Feature request

I've had the need to have some sort of "path enumeration", and figured out a SQL query (that I use as a view) to do that: ``` sql SELECT nodes.id...

Feature request

```ruby # lib/closure_tree/finders.rb def with_ancestor(*ancestors) ancestor_ids = ancestors.map { |ea| ea.is_a?(ActiveRecord::Base) ? ea._ct_id : ea } scope = ancestor_ids.blank? ? all : joins(:ancestor_hierarchies). where("#{_ct.hierarchy_table_name}.ancestor_id" => ancestor_ids). where("#{_ct.hierarchy_table_name}.generations > 0"). readonly(false)...

previously only sqlite3 was being tested in CI due to a configuration error.

Added test to verify that the multiple database is working

In `rails test`, the following test code causes an error: `SystemStackError: stack level too deep`. ```ruby node = nodes(:one) node.update(parent_id: node.id) ``` Node (class of the node) has closure tree...

```rb # Gemfile.lock … closure_tree (7.4.0) … ``` I managed to save the namespace (`Admin::`) for the `parent` method with the following code: ```rb # app/models/catalog.rb class Catalog < ApplicationRecord...

I wonder why there is no way to include the `ancestors` in the `with_ancestor` scope (see code below). It is a really common use case for my project, so I...

related issue: https://github.com/ClosureTree/closure_tree/issues/410 I feel that the unique compound index of `ancestor_id` and `descendant_id`, is needed and `generations` is redundant. Because there should be only one kind of `generations` for...

Say I have a model with numeric_order option: ```rb class Category < ApplicationRecord has_closure_tree order: "position", numeric_order: true end ``` With this setting we lose dirty tracking after setting the...