diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-28 19:56:54 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-28 19:57:43 -0500 |
commit | 39f0698405f8d52984f614d2aecafc514da9a3c5 (patch) | |
tree | 81dfb1c5627c125f534801232b2f66ac8b48240f /activerecord/lib/active_record/counter_cache.rb | |
parent | 68f23bea6b3eec48f26e87ab9cdf3ff361820831 (diff) | |
download | rails-39f0698405f8d52984f614d2aecafc514da9a3c5.tar.gz rails-39f0698405f8d52984f614d2aecafc514da9a3c5.tar.bz2 rails-39f0698405f8d52984f614d2aecafc514da9a3c5.zip |
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.
Diffstat (limited to 'activerecord/lib/active_record/counter_cache.rb')
0 files changed, 0 insertions, 0 deletions