aboutsummaryrefslogtreecommitdiffstats
path: root/railties/doc/guides/html/association_basics.html
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-11-04 18:14:29 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-11-04 18:14:29 +0100
commita909eecbbd42e70a5bc0e099485f07dc64db5d38 (patch)
treea685d297c7f11fa2ea87a5dd69ad7052696532d8 /railties/doc/guides/html/association_basics.html
parentb29f95ed9a4f09674a187b237acc143ac5f4ddde (diff)
parent18bf7b421d55c60029289edef1df409a58d021e4 (diff)
downloadrails-a909eecbbd42e70a5bc0e099485f07dc64db5d38.tar.gz
rails-a909eecbbd42e70a5bc0e099485f07dc64db5d38.tar.bz2
rails-a909eecbbd42e70a5bc0e099485f07dc64db5d38.zip
Dont log the _method attribute either. Its already available in the header
Diffstat (limited to 'railties/doc/guides/html/association_basics.html')
-rw-r--r--railties/doc/guides/html/association_basics.html10
1 files changed, 9 insertions, 1 deletions
diff --git a/railties/doc/guides/html/association_basics.html b/railties/doc/guides/html/association_basics.html
index 012a1a0156..9159eaab2a 100644
--- a/railties/doc/guides/html/association_basics.html
+++ b/railties/doc/guides/html/association_basics.html
@@ -691,7 +691,7 @@ http://www.gnu.org/software/src-highlite -->
belongs_to <span style="color: #990000">:</span>manager<span style="color: #990000">,</span> <span style="color: #990000">:</span>class_name <span style="color: #990000">=&gt;</span> <span style="color: #FF0000">"User"</span>
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
</tt></pre></div></div>
-<div class="para"><p>With this setup, you can retrieve <tt>@employee.subordinates</tt> and <tt>@employee.managers</tt>.</p></div>
+<div class="para"><p>With this setup, you can retrieve <tt>@employee.subordinates</tt> and <tt>@employee.manager</tt>.</p></div>
</div>
<h2 id="_tips_tricks_and_warnings">3. Tips, Tricks, and Warnings</h2>
<div class="sectionbody">
@@ -1185,6 +1185,14 @@ http://www.gnu.org/software/src-highlite -->
<div class="para"><p>If you set the <tt>:readonly</tt> option to <tt>true</tt>, then the associated object will be read-only when retrieved via the association.</p></div>
<h5 id="_tt_select_tt"><tt>:select</tt></h5>
<div class="para"><p>The <tt>:select</tt> option lets you override the SQL <tt>SELECT</tt> clause that is used to retrieve data about the associated object. By default, Rails retrieves all columns.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<img src="./images/icons/tip.png" alt="Tip" />
+</td>
+<td class="content">If you set the <tt>:select</tt> option on a <tt>belongs_to</tt> association, you should also set the <tt>foreign_key</tt> option to guarantee the correct results.</td>
+</tr></table>
+</div>
<h5 id="_tt_validate_tt"><tt>:validate</tt></h5>
<div class="para"><p>If you set the <tt>:validate</tt> option to <tt>true</tt>, then associated objects will be validated whenever you save this object. By default, this is <tt>false</tt>: associated objects will not be validated when this object is saved.</p></div>
<h4 id="_when_are_objects_saved">4.1.3. When are Objects Saved?</h4>