diff options
author | Xavier Noria <fxn@hashref.com> | 2011-06-23 18:08:11 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-06-23 18:08:11 +0200 |
commit | 1f505a8ef21a300c22e4c6a3cc4d3bf4cf1853de (patch) | |
tree | e6d3457116b06dac44554b4100ff2ddfd13a64ee /railties/guides/source/association_basics.textile | |
parent | d49622a1f211a036283dcd094c9da0da3bb39fa8 (diff) | |
parent | 06fe01a337ccf7f44bbaf272eddac284f80dcadb (diff) | |
download | rails-1f505a8ef21a300c22e4c6a3cc4d3bf4cf1853de.tar.gz rails-1f505a8ef21a300c22e4c6a3cc4d3bf4cf1853de.tar.bz2 rails-1f505a8ef21a300c22e4c6a3cc4d3bf4cf1853de.zip |
Merge branch 'master' of git://github.com/lifo/docrails
Diffstat (limited to 'railties/guides/source/association_basics.textile')
-rw-r--r-- | railties/guides/source/association_basics.textile | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile index 458bfefad8..3c2497e83a 100644 --- a/railties/guides/source/association_basics.textile +++ b/railties/guides/source/association_basics.textile @@ -1120,11 +1120,9 @@ h6(#has_many-collection-find). <tt><em>collection</em>.find(...)</tt> The <tt><em>collection</em>.find</tt> method finds objects within the collection. It uses the same syntax and options as +ActiveRecord::Base.find+. <ruby> -@open_orders = @customer.orders.all(:conditions => "open = 1") +@open_orders = @customer.orders.where(:open => 1) </ruby> -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(...)</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. |