rails/rails — pull request #6547 by frodsan (2012-05-30 04:09:11+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. Backport of #6511.