aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorMike Gunderloy <MikeG1@larkfarm.com>2008-11-08 06:25:21 -0600
committerMike Gunderloy <MikeG1@larkfarm.com>2008-11-08 06:25:21 -0600
commit367282a634a65c47f073ec8a5bf5c6d8c5916a73 (patch)
tree123a4579e083b53f84fc5b36afbe77d108436961 /railties
parent23adb6f7c7e0b76f9e28483a069fe587f30f4fb3 (diff)
downloadrails-367282a634a65c47f073ec8a5bf5c6d8c5916a73.tar.gz
rails-367282a634a65c47f073ec8a5bf5c6d8c5916a73.tar.bz2
rails-367282a634a65c47f073ec8a5bf5c6d8c5916a73.zip
Rewrite start of Finders guide to be more consistent with other guides.
Diffstat (limited to 'railties')
-rw-r--r--railties/doc/guides/source/finders.txt22
1 files changed, 9 insertions, 13 deletions
diff --git a/railties/doc/guides/source/finders.txt b/railties/doc/guides/source/finders.txt
index 738db04f3e..e5d94cffb0 100644
--- a/railties/doc/guides/source/finders.txt
+++ b/railties/doc/guides/source/finders.txt
@@ -1,21 +1,17 @@
Rails Finders
=============
-This guide is all about the +find+ method defined in +ActiveRecord::Base+, finding on associations, and associated goodness such as named scopes. You will learn how to be a find master.
+This guide covers the +find+ method defined in +ActiveRecord::Base+, as well as other ways of finding particular instances of your models. By using this guide, you will be able to:
-== In the beginning...
+* Find records using a variety of methods and conditions
+* Specify the order, retrieved attributes, grouping, and other properties of the found records
+* Use eager loading to cut down on the number of database queries in your application
+* Use dynamic finders
+* Create named scopes to add custom finding behavior to your models
+* Check for the existence of particular records
+* Perform aggregate calculations on Active Record models
-In the beginning there was SQL. SQL looked like this:
-
-[source,sql]
--------------------------------------------------------
-SELECT * FROM clients
-SELECT * FROM clients WHERE id = '1'
-SELECT * FROM clients LIMIT 0,1
-SELECT * FROM clients ORDER BY id DESC LIMIT 0,1
--------------------------------------------------------
-
-In Rails (unlike some other frameworks) you don't usually have to type SQL because Active Record is there to help you find your records.
+If you're used to using raw SQL to find database records, you'll find that there are generally better ways to carry out the same operations in Rails. Active Record insulates you from the need to use SQL in most cases.
== The Sample Models