Skip to content

Commit 301e2c1

Browse files
committed
Create gh-pages branch via GitHub
1 parent e3ef40b commit 301e2c1

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

index.html

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ <h3>
5050
and tracking user referrals.</p>
5151

5252
<p><a href="http://travis-ci.org/mceachen/closure_tree"><img src="https://secure.travis-ci.org/mceachen/closure_tree.png?branch=master" alt="Build Status"></a>
53-
<a href="http://rubygems.org/gems/closure_tree"><img src="https://badge.fury.io/rb/closure_tree.png" alt="Gem Version"></a></p>
53+
<a href="http://rubygems.org/gems/closure_tree"><img src="https://badge.fury.io/rb/closure_tree.png" alt="Gem Version"></a>
54+
<a href="https://codeclimate.com/github/mceachen/closure_tree"><img src="https://codeclimate.com/github/mceachen/closure_tree.png" alt="Code Climate"></a></p>
5455

5556
<p>Substantially more efficient than
5657
<a href="https://github.com/stefankroes/ancestry">ancestry</a> and
@@ -211,7 +212,8 @@ <h3>
211212
column is <code>name</code>, which can be changed with the :name_column option
212213
provided to <code>acts_as_tree</code>.</p>
213214

214-
<p>Note that any other AR fields can be set with the second, optional <code>attributes</code> argument.</p>
215+
<p>Note that any other AR fields can be set with the second, optional <code>attributes</code> argument,
216+
and as of version 4.2.0, these attributes are added to the where clause as selection criteria.</p>
215217

216218
<div class="highlight"><pre><span class="n">child</span> <span class="o">=</span> <span class="no">Tag</span><span class="o">.</span><span class="n">find_or_create_by_path</span><span class="p">(</span><span class="sx">%w{home chuck Photos"}</span><span class="p">,</span> <span class="p">{</span><span class="ss">:tag_type</span> <span class="o">=&gt;</span> <span class="s2">"File"</span><span class="p">})</span>
217219
</pre></div>
@@ -332,11 +334,13 @@ <h3>
332334
<li>
333335
<code>Tag.hash_tree</code> returns an <a href="#nested-hashes">ordered, nested hash</a> that can be depth-limited.</li>
334336
<li>
335-
<code>Tag.find_by_path(path)</code> returns the node whose name path is <code>path</code>. See (#find_or_create_by_path).</li>
337+
<code>Tag.find_by_path(path, attributes)</code> returns the node whose name path is <code>path</code>. See (#find_or_create_by_path).</li>
336338
<li>
337-
<code>Tag.find_or_create_by_path(path)</code> returns the node whose name path is <code>path</code>, and will create the node if it doesn't exist already.See (#find_or_create_by_path).</li>
339+
<code>Tag.find_or_create_by_path(path, attributes)</code> returns the node whose name path is <code>path</code>, and will create the node if it doesn't exist already.See (#find_or_create_by_path).</li>
338340
<li>
339341
<code>Tag.find_all_by_generation(generation_level)</code> returns the descendant nodes who are <code>generation_level</code> away from a root. <code>Tag.find_all_by_generation(0)</code> is equivalent to <code>Tag.roots</code>.</li>
342+
<li>
343+
<code>Tag.with_ancestor(ancestors)</code> scopes to all descendants whose ancestor is in the given list.</li>
340344
</ul><h3>
341345
<a name="instance-methods" class="anchor" href="#instance-methods"><span class="octicon octicon-link"></span></a>Instance methods</h3>
342346

@@ -590,6 +594,19 @@ <h2>
590594
<a name="change-log" class="anchor" href="#change-log"><span class="octicon octicon-link"></span></a>Change log</h2>
591595

592596
<h3>
597+
<a name="420" class="anchor" href="#420"><span class="octicon octicon-link"></span></a>4.2.0</h3>
598+
599+
<ul>
600+
<li>Added <code>with_ancestor(*ancestors)</code>. Thanks for the idea, <a href="https://github.com/mgornick">Matt</a>!</li>
601+
<li>Applied <a href="https://github.com/leonelgalan">Leonel Galan</a>'s fix for Strong Attribute support</li>
602+
<li>
603+
<code>find_or_create_by</code> now uses passed-in attributes as both selection and creation criteria.
604+
Thanks for the help, <a href="https://github.com/juddblair">Judd Blair</a>!
605+
<strong>Please note that this changes prior behavior—test your code with this new version!</strong>
606+
</li>
607+
<li>
608+
<code>ct_advisory_lock</code> was moved into the <code>_ct</code> support class, to reduce model method pollution</li>
609+
</ul><h3>
593610
<a name="410" class="anchor" href="#410"><span class="octicon octicon-link"></span></a>4.1.0</h3>
594611

595612
<ul>

0 commit comments

Comments
 (0)