README.md in closure_tree-5.2.0 vs README.md in closure_tree-6.0.0.alpha
- old
+ new
@@ -24,12 +24,12 @@
* [Find a node by ancestry path](#find_or_create_by_path) in 1 SELECT.
* __Best-in-class mutation performance__:
* 2 SQL INSERTs on node creation
* 3 SQL INSERT/UPDATEs on node reparenting
* __Support for [concurrency](#concurrency)__ (using [with_advisory_lock](https://github.com/mceachen/with_advisory_lock))
-* __Support for Rails 3.2, 4.0, and 4.1__
-* __Support for Ruby 1.9, 2.1, and jRuby 1.6.13__
+* __Support for ActiveRecord 4.1, 4.2 and 5.0.alpha__
+* __Support for Ruby 2.2 and JRuby 9000__
* Support for reparenting children (and all their descendants)
* Support for [single-table inheritance (STI)](#sti) within the hierarchy
* ```find_or_create_by_path``` for [building out heterogeneous hierarchies quickly and conveniently](#find_or_create_by_path)
* Support for [deterministic ordering](#deterministic-ordering)
* Support for [preordered](http://en.wikipedia.org/wiki/Tree_traversal#Pre-order) traversal of descendants
@@ -53,11 +53,11 @@
- [Testing](#testing)
- [Change log](#change-log)
## Installation
-Note that closure_tree only supports Rails 3.2 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.
+Note that closure_tree only supports ActiveRecord 4.1 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.
1. Add `gem 'closure_tree'` to your Gemfile
2. Run `bundle install`
@@ -80,11 +80,11 @@
If you're already using other hierarchical gems, like `ancestry` or `acts_as_tree`, please refer
to the [warning section](#warning)!
4. Add a migration to add a `parent_id` column to the hierarchical model.
- You may want to also [add a column for deterministic ordering of children](#sort_order), but that's optional.
+ You may want to also [add a column for deterministic ordering of children](#deterministic-ordering), but that's optional.
```ruby
class AddParentIdToTag < ActiveRecord::Migration
def change
add_column :tag, :parent_id, :integer
@@ -337,31 +337,10 @@
class WhenTag < Tag ; end
class WhereTag < Tag ; end
class WhatTag < Tag ; end
```
-Please note that Rails (<= 3.2) doesn't handle polymorphic associations correctly if
-you use the ```:type``` attribute, so **this doesn't work**:
-
-```ruby
-# BAD: ActiveRecord ignores the :type attribute:
-root.children.create(name: "child", type: "WhenTag")
-```
-
-Instead, use either ```.add_child``` or ```children <<```:
-
-```ruby
-# GOOD!
-a = Tag.create!(name: "a")
-b = WhenTag.new(name: "b")
-a.children << b
-c = WhatTag.new(name: "c")
-b.add_child(c)
-```
-
-See [issue 43](https://github.com/mceachen/closure_tree/issues/43) for more information.
-
## Deterministic ordering
By default, children will be ordered by your database engine, which may not be what you want.
If you want to order children alphabetically, and your model has a ```name``` column, you'd do this:
@@ -557,13 +536,12 @@
## Testing
Closure tree is [tested under every valid combination](http://travis-ci.org/#!/mceachen/closure_tree) of
-* Ruby 1.9.3, 2.1.2 (and sometimes head)
-* Rubinius 2.2.1+ (and sometimes head)
-* jRuby 1.9mode (and sometimes head)
-* The latest Rails 3.2, 4.0, 4.1 and master branches
+* Ruby 2.2 (and sometimes head)
+* jRuby 9000 (and sometimes head)
+* The latest ActiveRecord 4.1, 4.2, and master branch
* Concurrency tests for MySQL and PostgreSQL. SQLite is tested in a single-threaded environment.
Assuming you're using [rbenv](https://github.com/sstephenson/rbenv), you can use ```tests.sh``` to
run the test matrix locally.