rails/rails — pull request #6511 by frodsan (2012-05-28 01:24:49+00:00)
Title: Add support for CollectionAssociation#delete by Fixnum or String

I found the next issue between CollectionAssociation `delete`
and `destroy`.

class Person < ActiveRecord::Base
has_many :pets
end

person.pets.destroy(1)
# => OK, returns the destroyed object

person.pets.destroy("2")
# => OK, returns the destroyed object

person.pets.delete(1)
# => ActiveRecord::AssociationTypeMismatch

person.pets.delete("2")
# => ActiveRecord::AssociationTypeMismatch

Adding support for deleting with a fixnum or string like
`destroy` method.

Also, fixes #6509.