Skip to content

Commit f7fe6ca

Browse files
committed
Create gh-pages branch via GitHub
1 parent d9d2e8a commit f7fe6ca

File tree

2 files changed

+8
-26
lines changed

2 files changed

+8
-26
lines changed

index.html

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ <h3>
8383
</li>
8484
<li>
8585
<strong>Support for <a href="#concurrency">concurrency</a></strong> (using <a href="https://github.com/mceachen/with_advisory_lock">with_advisory_lock</a>)</li>
86-
<li><strong>Support for Rails 3.2, 4.0, and 4.1</strong></li>
87-
<li><strong>Support for Ruby 1.9, 2.1, and jRuby 1.6.13</strong></li>
86+
<li><strong>Support for ActiveRecord 4.1, 4.2 and 5.0.alpha</strong></li>
87+
<li><strong>Support for Ruby 2.2 and JRuby 9000</strong></li>
8888
<li>Support for reparenting children (and all their descendants)</li>
8989
<li>Support for <a href="#sti">single-table inheritance (STI)</a> within the hierarchy</li>
9090
<li>
@@ -121,7 +121,7 @@ <h2>
121121
<h2>
122122
<a id="installation" class="anchor" href="#installation" aria-hidden="true"><span class="octicon octicon-link"></span></a>Installation</h2>
123123

124-
<p>Note that closure_tree only supports Rails 3.2 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.</p>
124+
<p>Note that closure_tree only supports ActiveRecord 4.1 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.</p>
125125

126126
<ol>
127127
<li><p>Add <code>gem 'closure_tree'</code> to your Gemfile </p></li>
@@ -147,7 +147,7 @@ <h2>
147147
</li>
148148
<li>
149149
<p>Add a migration to add a <code>parent_id</code> column to the hierarchical model.
150-
You may want to also <a href="#sort_order">add a column for deterministic ordering of children</a>, but that's optional.</p>
150+
You may want to also <a href="#deterministic-ordering">add a column for deterministic ordering of children</a>, but that's optional.</p>
151151

152152
<div class="highlight highlight-ruby"><pre><span class="pl-k">class</span> <span class="pl-en">AddParentIdToTag<span class="pl-e"> &lt; ActiveRecord::Migration</span></span>
153153
<span class="pl-k">def</span> <span class="pl-en">change</span>
@@ -458,23 +458,6 @@ <h2>
458458
<span class="pl-k">class</span> <span class="pl-en">WhereTag<span class="pl-e"> &lt; Tag</span></span> ; <span class="pl-k">end</span>
459459
<span class="pl-k">class</span> <span class="pl-en">WhatTag<span class="pl-e"> &lt; Tag</span></span> ; <span class="pl-k">end</span></pre></div>
460460

461-
<p>Please note that Rails (&lt;= 3.2) doesn't handle polymorphic associations correctly if
462-
you use the <code>:type</code> attribute, so <strong>this doesn't work</strong>:</p>
463-
464-
<div class="highlight highlight-ruby"><pre><span class="pl-c"># BAD: ActiveRecord ignores the :type attribute:</span>
465-
root.children.create(<span class="pl-c1">name:</span> <span class="pl-s"><span class="pl-pds">"</span>child<span class="pl-pds">"</span></span>, <span class="pl-c1">type:</span> <span class="pl-s"><span class="pl-pds">"</span>WhenTag<span class="pl-pds">"</span></span>)</pre></div>
466-
467-
<p>Instead, use either <code>.add_child</code> or <code>children &lt;&lt;</code>:</p>
468-
469-
<div class="highlight highlight-ruby"><pre><span class="pl-c"># GOOD!</span>
470-
a <span class="pl-k">=</span> <span class="pl-c1">Tag</span>.create!(<span class="pl-c1">name:</span> <span class="pl-s"><span class="pl-pds">"</span>a<span class="pl-pds">"</span></span>)
471-
b <span class="pl-k">=</span> <span class="pl-c1">WhenTag</span>.<span class="pl-k">new</span>(<span class="pl-c1">name:</span> <span class="pl-s"><span class="pl-pds">"</span>b<span class="pl-pds">"</span></span>)
472-
a.children <span class="pl-k">&lt;&lt;</span> b
473-
c <span class="pl-k">=</span> <span class="pl-c1">WhatTag</span>.<span class="pl-k">new</span>(<span class="pl-c1">name:</span> <span class="pl-s"><span class="pl-pds">"</span>c<span class="pl-pds">"</span></span>)
474-
b.add_child(c)</pre></div>
475-
476-
<p>See <a href="https://github.com/mceachen/closure_tree/issues/43">issue 43</a> for more information.</p>
477-
478461
<h2>
479462
<a id="deterministic-ordering" class="anchor" href="#deterministic-ordering" aria-hidden="true"><span class="octicon octicon-link"></span></a>Deterministic ordering</h2>
480463

@@ -694,10 +677,9 @@ <h2>
694677
<p>Closure tree is <a href="http://travis-ci.org/#!/mceachen/closure_tree">tested under every valid combination</a> of</p>
695678

696679
<ul>
697-
<li>Ruby 1.9.3, 2.1.2 (and sometimes head)</li>
698-
<li>Rubinius 2.2.1+ (and sometimes head)</li>
699-
<li>jRuby 1.9mode (and sometimes head)</li>
700-
<li>The latest Rails 3.2, 4.0, 4.1, 4.2 and master branches</li>
680+
<li>Ruby 2.2 (and sometimes head)</li>
681+
<li>jRuby 9000 (and sometimes head)</li>
682+
<li>The latest ActiveRecord 4.1, 4.2, and master branch</li>
701683
<li>Concurrency tests for MySQL and PostgreSQL. SQLite is tested in a single-threaded environment.</li>
702684
</ul>
703685

0 commit comments

Comments
 (0)