diff options
author | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-10-29 08:16:40 -0500 |
---|---|---|
committer | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-10-29 08:16:40 -0500 |
commit | d83eda9b696f2e51c0c79dfd028b8b2d20160426 (patch) | |
tree | bf8c9be448142967e946c07ad16b957bf63e4ef8 /railties/doc/guides/source | |
parent | 40d049e981cbf7d73debcd1e3d16bde420590897 (diff) | |
download | rails-d83eda9b696f2e51c0c79dfd028b8b2d20160426.tar.gz rails-d83eda9b696f2e51c0c79dfd028b8b2d20160426.tar.bz2 rails-d83eda9b696f2e51c0c79dfd028b8b2d20160426.zip |
Clarify use of :select on :belongs_to in AR Associations Guide
Diffstat (limited to 'railties/doc/guides/source')
-rw-r--r-- | railties/doc/guides/source/association_basics.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/doc/guides/source/association_basics.txt b/railties/doc/guides/source/association_basics.txt index 7ab42dafbe..5ba616642b 100644 --- a/railties/doc/guides/source/association_basics.txt +++ b/railties/doc/guides/source/association_basics.txt @@ -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. |