From d24914c2e8f38a018b4855d65008d07b8ba8bb5b Mon Sep 17 00:00:00 2001
From: Kulbir Saini <kulbirsaini25@gmail.com>
Date: Fri, 24 Sep 2010 04:27:51 +0530
Subject: Fixes in associations_basics guide.

---
 railties/guides/source/association_basics.textile | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

(limited to 'railties/guides/source/association_basics.textile')

diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile
index 3bf1c6295d..6996dab8c5 100644
--- a/railties/guides/source/association_basics.textile
+++ b/railties/guides/source/association_basics.textile
@@ -1029,7 +1029,7 @@ When you declare a +has_many+ association, the declaring class automatically gai
 * <tt><em>collection</em>.empty?</tt>
 * <tt><em>collection</em>.size</tt>
 * <tt><em>collection</em>.find(...)</tt>
-* <tt><em>collection</em>.where(:conditions)</tt>
+* <tt><em>collection</em>.where(...)</tt>
 * <tt><em>collection</em>.exists?(...)</tt>
 * <tt><em>collection</em>.build(attributes = {}, ...)</tt>
 * <tt><em>collection</em>.create(attributes = {})</tt>
@@ -1055,7 +1055,7 @@ orders.clear
 orders.empty?
 orders.size
 orders.find(...)
-orders.where(:conditions)
+orders.where(...)
 orders.exists?(...)
 orders.build(attributes = {}, ...)
 orders.create(attributes = {})
@@ -1134,15 +1134,15 @@ The <tt><em>collection</em>.find</tt> method finds objects within the collection
 @open_orders = @customer.orders.find(:all, :conditions => "open = 1")
 </ruby>
 
-WARNING: Starting Rails 3, supplying options to +ActiveRecord::Base.find+ method is depricated. Use <tt><em>collection</em>.where</tt> instead when you need to pass conditions.
+NOTE: Starting Rails 3, supplying options to +ActiveRecord::Base.find+ method is discouraged. Use <tt><em>collection</em>.where</tt> instead when you need to pass conditions.
 
-h6(#has_many-collection-where). <tt><em>collection</em>.where(:conditions)</tt>
+h6(#has_many-collection-where). <tt><em>collection</em>.where(...)</tt>
 
 The <tt><em>collection</em>.where</tt> method finds objects within the collection based on the conditions supplied but the objects are loaded lazily meaning that the database is queried only when the object(s) are accessed.
 
 <ruby>
-@open_orders = @customer.orders.where(:open => 1) # No query yet
-@open_order = @open_orders.first # Now the database will queried
+@open_orders = @customer.orders.where(:open => true) # No query yet
+@open_order = @open_orders.first # Now the database will be queried
 </ruby>
 
 h6(#has_many-collection-exists). <tt><em>collection</em>.exists?(...)</tt>
@@ -1452,7 +1452,7 @@ When you declare a +has_and_belongs_to_many+ association, the declaring class au
 * <tt><em>collection</em>.empty?</tt>
 * <tt><em>collection</em>.size</tt>
 * <tt><em>collection</em>.find(...)</tt>
-* <tt><em>collection</em>.where(:conditions)</tt>
+* <tt><em>collection</em>.where(...)</tt>
 * <tt><em>collection</em>.exists?(...)</tt>
 * <tt><em>collection</em>.build(attributes = {})</tt>
 * <tt><em>collection</em>.create(attributes = {})</tt>
@@ -1478,7 +1478,7 @@ assemblies.clear
 assemblies.empty?
 assemblies.size
 assemblies.find(...)
-assemblies.where(:conditions)
+assemblies.where(...)
 assemblies.exists?(...)
 assemblies.build(attributes = {}, ...)
 assemblies.create(attributes = {})
@@ -1564,9 +1564,9 @@ The <tt><em>collection</em>.find</tt> method finds objects within the collection
   :conditions => ["created_at > ?", 2.days.ago])
 </ruby>
 
-WARNING: Starting Rails 3, supplying options to +ActiveRecord::Base.find+ method is depricated. Use <tt><em>collection</em>.where</tt> instead when you need to pass conditions.
+NOTE: Starting Rails 3, supplying options to +ActiveRecord::Base.find+ method is discouraged. Use <tt><em>collection</em>.where</tt> instead when you need to pass conditions.
 
-h6(#has_and_belongs_to_many-collection-where). <tt><em>collection</em>.where(:conditions)</tt>
+h6(#has_and_belongs_to_many-collection-where). <tt><em>collection</em>.where(...)</tt>
 
 The <tt><em>collection</em>.where</tt> method finds objects within the collection based on the conditions supplied but the objects are loaded lazily meaning that the database is queried only when the object(s) are accessed. It also adds the additional condition that the object must be in the collection.
 
-- 
cgit v1.2.3

