{"repo":"1and1/acts_as_recursive_tree","free":true,"listed":false,"github":"https://github.com/1and1/acts_as_recursive_tree","clone":"git clone https://github.com/1and1/acts_as_recursive_tree.git","description":"Make use of recursive queries in Rails when using Postgresql or SQLite","language":"Ruby","stars":84,"topics":["rails","ruby","postgresql","sqlite3","activerecord"],"license":"MIT","category":"databases-storage","readme_excerpt":"ActsAsRecursiveTree Use the power of recursive SQL statements in your Rails application. When you have tree based data in your application, you always to struggle with retrieving data. There are solutions, but the always come at a price: Nested Set is fast at retrieval, but when inserting you might have to rearrange bounds, which can be very complex Closure Tree stores additional data in a separate table, which has be kept up to date Luckily, there is already a SQL standard that makes it very easy to retrieve data in the traditional parent/child relation. Currently this is only supported in sqlite and Postgres. With this it is possible to query complete trees without the need of extra tables or indices. Supported environments ActsAsRecursiveTree currently supports following ActiveRecord versions and is tested for compatibility: ActiveRecord 7.0.x ActiveRecord 7.1.x ActiveRecord 7.2.x ActiveRecord 8.0.x ActiveRecord 8.1.x ActiveRecord NEXT (from git) Supported Rubies ActsAsRecursiveTree is tested with following rubies: MRuby 3.1 MRuby 3.2 MRuby 3.3 MRuby 3.4 MRuby 4.0 Other Ruby implementations are not tested, but should also work. Installation Add this line to your application's Gemfile: And then execute: $ bundle Or install it yourself as: $ gem install acts as recursive tree In your model class add following line: That's it. This will assume that your model has a column named parent id which will be used for traversal. If your column is something different, then you can spe","default_branch":null,"files":null,"tree":[],"storefront":"/r/1and1","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/1and1/acts_as_recursive_tree/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}