Permalink
Browse files

fix AR::Associations::CollectionProxy#delete broken documentation [ci…

… skip]
  • Loading branch information...
1 parent 0803548 commit e216b00a5ef6038ba227faf3207891c403fb8d1c Francesco Rodriguez committed Sep 22, 2012
Showing with 2 additions and 23 deletions.
  1. +2 −23 activerecord/lib/active_record/associations/collection_proxy.rb
@@ -51,7 +51,6 @@ def loaded?
@association.loaded?
end
- ##
# Works in two ways.
#
# *First:* Specify a subset of fields to be selected from the result set.
@@ -109,9 +108,8 @@ def select(select = nil, &block)
@association.select(select, &block)
end
- ##
# Finds an object in the collection responding to the +id+. Uses the same
- # rules as +ActiveRecord::Base.find+. Returns +ActiveRecord::RecordNotFound++
+ # rules as <tt>ActiveRecord::Base.find</tt>. Returns <tt>ActiveRecord::RecordNotFound</tt>
# error if the object can not be found.
#
# class Person < ActiveRecord::Base
@@ -140,7 +138,6 @@ def find(*args, &block)
@association.find(*args, &block)
end
- ##
# Returns the first record, or the first +n+ records, from the collection.
# If the collection is empty, the first form returns +nil+, and the second
# form returns an empty array.
@@ -171,7 +168,6 @@ def first(*args)
@association.first(*args)
end
- ##
# Returns the last record, or the last +n+ records, from the collection.
# If the collection is empty, the first form returns +nil+, and the second
# form returns an empty array.
@@ -202,7 +198,6 @@ def last(*args)
@association.last(*args)
end
- ##
# Returns a new object of the collection type that has been instantiated
# with +attributes+ and linked to this object, but have not yet been saved.
# You can pass an array of attributes hashes, this will return an array
@@ -231,7 +226,6 @@ def build(attributes = {}, &block)
@association.build(attributes, &block)
end
- ##
# Returns a new object of the collection type that has been instantiated with
# attributes, linked to this object and that has already been saved (if it
# passes the validations).
@@ -262,7 +256,6 @@ def create(attributes = {}, &block)
@association.create(attributes, &block)
end
- ##
# Like +create+, except that if the record is invalid, raises an exception.
#
# class Person
@@ -279,7 +272,6 @@ def create!(attributes = {}, &block)
@association.create!(attributes, &block)
end
- ##
# Add one or more records to the collection by setting their foreign keys
# to the association's primary key. Since << flattens its argument list and
# inserts each record, +push+ and +concat+ behave identically. Returns +self+
@@ -308,7 +300,6 @@ def concat(*records)
@association.concat(*records)
end
- ##
# Replace this collection with +other_array+. This will perform a diff
# and delete/add only records that have changed.
#
@@ -335,7 +326,6 @@ def replace(other_array)
@association.replace(other_array)
end
- ##
# Deletes all the records from the collection. For +has_many+ associations,
# the deletion is done according to the strategy specified by the <tt>:dependent</tt>
# option. Returns an array with the deleted records.
@@ -428,7 +418,6 @@ def delete_all
@association.delete_all
end
- ##
# Deletes the records of the collection directly from the database.
# This will _always_ remove the records ignoring the +:dependent+
# option.
@@ -455,7 +444,6 @@ def destroy_all
@association.destroy_all
end
- ##
# Deletes the +records+ supplied and removes them from the collection. For
# +has_many+ associations, the deletion is done according to the strategy
# specified by the <tt>:dependent</tt> option. Returns an array with the
@@ -519,7 +507,7 @@ def destroy_all
# Pet.find(1, 3)
# # => ActiveRecord::RecordNotFound: Couldn't find all Pets with IDs (1, 3)
#
- # If it is set to <tt>:delete_all</tt>, all the +records+ are deleted
+ # If it is set to <tt>:delete_all</tt>, all the +records+ are deleted
# *without* calling their +destroy+ method.
#
# class Person < ActiveRecord::Base
@@ -574,7 +562,6 @@ def delete(*records)
@association.delete(*records)
end
- ##
# Destroys the +records+ supplied and removes them from the collection.
# This method will _always_ remove record from the database ignoring
# the +:dependent+ option. Returns an array with the removed records.
@@ -647,7 +634,6 @@ def destroy(*records)
@association.destroy(*records)
end
- ##
# Specifies whether the records should be unique or not.
#
# class Person < ActiveRecord::Base
@@ -666,7 +652,6 @@ def uniq
@association.uniq
end
- ##
# Count all records using SQL.
#
# class Person < ActiveRecord::Base
@@ -684,7 +669,6 @@ def count(column_name = nil, options = {})
@association.count(column_name, options)
end
- ##
# Returns the size of the collection. If the collection hasn't been loaded,
# it executes a <tt>SELECT COUNT(*)</tt> query.
#
@@ -709,7 +693,6 @@ def size
@association.size
end
- ##
# Returns the size of the collection calling +size+ on the target.
# If the collection has been already loaded, +length+ and +size+ are
# equivalent.
@@ -733,7 +716,6 @@ def length
@association.length
end
- ##
# Returns +true+ if the collection is empty.
#
# class Person < ActiveRecord::Base
@@ -751,7 +733,6 @@ def empty?
@association.empty?
end
- ##
# Returns +true+ if the collection is not empty.
#
# class Person < ActiveRecord::Base
@@ -785,7 +766,6 @@ def any?(&block)
@association.any?(&block)
end
- ##
# Returns true if the collection has more than one record.
# Equivalent to <tt>collection.size > 1</tt>.
#
@@ -824,7 +804,6 @@ def many?(&block)
@association.many?(&block)
end
- ##
# Returns +true+ if the given object is present in the collection.
#
# class Person < ActiveRecord::Base

0 comments on commit e216b00

Please sign in to comment.