aboutsummaryrefslogtreecommitdiffstats
path: root/railties/doc/guides/source/association_basics.txt
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-11-02 04:02:40 +0530
committerPratik Naik <pratiknaik@gmail.com>2008-11-02 04:02:40 +0530
commitb047929c14f088d535eea460ddd8769f43cd4ae5 (patch)
tree221d816ef0c908044fd6029950ccad064866ab8f /railties/doc/guides/source/association_basics.txt
parent5a02f0bccf55191c2cfbcc69bd8165df6d7a2012 (diff)
downloadrails-b047929c14f088d535eea460ddd8769f43cd4ae5.tar.gz
rails-b047929c14f088d535eea460ddd8769f43cd4ae5.tar.bz2
rails-b047929c14f088d535eea460ddd8769f43cd4ae5.zip
Merge with docrails
Diffstat (limited to 'railties/doc/guides/source/association_basics.txt')
-rw-r--r--railties/doc/guides/source/association_basics.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/doc/guides/source/association_basics.txt b/railties/doc/guides/source/association_basics.txt
index 695b834652..5ba616642b 100644
--- a/railties/doc/guides/source/association_basics.txt
+++ b/railties/doc/guides/source/association_basics.txt
@@ -359,7 +359,7 @@ class Employee < ActiveRecord::Base
end
-------------------------------------------------------
-With this setup, you can retrieve +@employee.subordinates+ and +@employee.managers+.
+With this setup, you can retrieve +@employee.subordinates+ and +@employee.manager+.
== Tips, Tricks, and Warnings
@@ -765,6 +765,8 @@ If you set the +:readonly+ option to +true+, then the associated object will be
The +:select+ option lets you override the SQL +SELECT+ clause that is used to retrieve data about the associated object. By default, Rails retrieves all columns.
+TIP: If you set the +:select+ option on a +belongs_to+ association, you should also set the +foreign_key+ option to guarantee the correct results.
+
===== +:validate+
If you set the +:validate+ option to +true+, then associated objects will be validated whenever you save this object. By default, this is +false+: associated objects will not be validated when this object is saved.