Skip to content

Commit

Permalink
in associations guide: exist? -> exists?, thanks to Peter Zlatnar
Browse files Browse the repository at this point in the history
  • Loading branch information
fxn committed May 23, 2009
1 parent 9d316bb commit 402f08f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions railties/guides/source/association_basics.textile
Expand Up @@ -1019,7 +1019,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>.exist?(...)</tt>
* <tt><em>collection</em>.exists?(...)</tt>
* <tt><em>collection</em>.build(attributes = {}, ...)</tt>
* <tt><em>collection</em>.create(attributes = {})</tt>

Expand All @@ -1044,7 +1044,7 @@ orders.clear
orders.empty?
orders.size
orders.find(...)
orders.exist?(...)
orders.exists?(...)
orders.build(attributes = {}, ...)
orders.create(attributes = {})
</ruby>
Expand Down Expand Up @@ -1122,9 +1122,9 @@ The <tt><em>collection</em>.find</tt> method finds objects within the collection
@open_orders = @customer.orders.find(:all, :conditions => "open = 1")
</ruby>

h6. <tt><em>collection</em>.exist?(...)</tt>
h6. <tt><em>collection</em>.exists?(...)</tt>

The <tt><em>collection</em>.exist?</tt> method checks whether an object meeting the supplied conditions exists in the collection. It uses the same syntax and options as +ActiveRecord::Base.exists?+.
The <tt><em>collection</em>.exists?</tt> method checks whether an object meeting the supplied conditions exists in the collection. It uses the same syntax and options as +ActiveRecord::Base.exists?+.

h6. <tt><em>collection</em>.build(attributes = {}, ...)</tt>

Expand Down Expand Up @@ -1395,7 +1395,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>.exist?(...)</tt>
* <tt><em>collection</em>.exists?(...)</tt>
* <tt><em>collection</em>.build(attributes = {})</tt>
* <tt><em>collection</em>.create(attributes = {})</tt>

Expand All @@ -1420,7 +1420,7 @@ assemblies.clear
assemblies.empty?
assemblies.size
assemblies.find(...)
assemblies.exist?(...)
assemblies.exists?(...)
assemblies.build(attributes = {}, ...)
assemblies.create(attributes = {})
</ruby>
Expand Down Expand Up @@ -1505,9 +1505,9 @@ The <tt><em>collection</em>.find</tt> method finds objects within the collection
:conditions => ["created_at > ?", 2.days.ago])
</ruby>

h6. <tt><em>collection</em>.exist?(...)</tt>
h6. <tt><em>collection</em>.exists?(...)</tt>

The <tt><em>collection</em>.exist?</tt> method checks whether an object meeting the supplied conditions exists in the collection. It uses the same syntax and options as +ActiveRecord::Base.exists?+.
The <tt><em>collection</em>.exists?</tt> method checks whether an object meeting the supplied conditions exists in the collection. It uses the same syntax and options as +ActiveRecord::Base.exists?+.

h6. <tt><em>collection</em>.build(attributes = {})</tt>

Expand Down

0 comments on commit 402f08f

Please sign in to comment.