closure_tree
closure_tree copied to clipboard
Easily and efficiently make your ActiveRecord models support hierarchies
This implements a `counter_cache` option, which is passed to the `parent` relationship. This allows closure tree structures to use `tag.tags_count` rather than `tag.children.count`. This is much faster for large data...
Is it possible to use deterministic ordering, but supply two columns and if the value for the first is `null` take the second value? For instance, to achieve this in...
having elements with position 0,1,2,3,4,5 and item 5 gets and update to be position 0. there seem to be no automatic reordering, leaving the list with 0,0,1,2,3,4. what's the most...
https://github.com/ClosureTree/closure_tree/issues/376 in order to respect a certain children order when calling rebuild! the children will be reordered with whatever the argument of `child_order` was
When there is a lot of data, the relational table will generate a lot of data. How to deal with it to ensure performance?
We see a lot of lock timeouts due to the advisory lock. Right now, we see that the advisory lock uses the class name to determine the unique name. But...
Problem: When using `numeric_ordering: true`, closure_tree tries to find out the type of database during the initialization process. This can be problematic, for example when doing `rails db:create`, in which...
Hi there, When using `closure_tree order: "column"`, I get an ActiveRecord warning when I create a record that calls the `ClosureTree::HierarchyMaintenance#rebuild!` method. The offending line is the following line :...
``` delete FROM `fc_location_hierarchies` WHERE descendant_id IN (SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM `fc_location_hierarchies` WHERE ancestor_id = 46179 OR descendant_id = 46179) AS x); Query OK, 0 rows affected...
Reviving #320 under a different organization and on the latest version of master. The call to release_connection, added in #263, might release a connection that was opened outside of has_closure_tree...