aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-12-23 15:44:12 +1000
committerRyan Bigg <radarlistener@gmail.com>2010-12-23 15:44:12 +1000
commitcef17cd705c3529139fa1fd5bbc0e9c6ae289ba4 (patch)
treee065085bf69b51980e9642dd7ff355259586f7ea /railties
parent0795c3a15eccf5406220134fae3f4b44be030655 (diff)
downloadrails-cef17cd705c3529139fa1fd5bbc0e9c6ae289ba4.tar.gz
rails-cef17cd705c3529139fa1fd5bbc0e9c6ae289ba4.tar.bz2
rails-cef17cd705c3529139fa1fd5bbc0e9c6ae289ba4.zip
Query guide: specify what type of objects scopes return
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/active_record_querying.textile2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile
index b315a2b107..5264477e1c 100644
--- a/railties/guides/source/active_record_querying.textile
+++ b/railties/guides/source/active_record_querying.textile
@@ -723,7 +723,7 @@ Even though Active Record lets you specify conditions on the eager loaded associ
h3. Scopes
-Scoping allows you to specify commonly-used ARel queries which can be referenced as method calls on the association objects or models. With these scopes, you can use every method previously covered such as +where+, +joins+ and +includes+.
+Scoping allows you to specify commonly-used ARel queries which can be referenced as method calls on the association objects or models. With these scopes, you can use every method previously covered such as +where+, +joins+ and +includes+. All scope methods will return an +ActiveRecord::Relation+ object which will allow for further methods (such as other scopes) to be called on it.
To define a simple scope, we use the +scope+ method inside the class, passing the ARel query that we'd like run when this scope is called: