This project is archived and is in readonly mode.
delete_all doesn't respect scope
Reported by Mislav | November 17th, 2009 @ 01:33 PM
This was tested in latest 2.3 stable branch:
>> Media.scoped(:conditions => 'size = 0').all
Media Load (0.4ms) SELECT * FROM `medias` WHERE (size = 0)
>> Media.scoped(:conditions => 'size = 0').delete_all
Media Delete all (0.3ms) DELETE FROM `medias`
It had caused me to delete all the records from one of our tables in production.
Comments and changes to this ticket
-
Mislav November 17th, 2009 @ 01:40 PM
Cancel this. Further investigation showed that this is not broken in ActiveRecord, only in our app. Turned out the "is_paranoid" plugin re-defines
delete_all
to use an exclusive scope. -
CancelProfileIsBroken November 17th, 2009 @ 02:43 PM
- State changed from new to invalid
-
csnk May 18th, 2011 @ 08:30 AM
- Importance changed from to
We are the professional clothing manufacturer and clothing supplier, so we manufacture kinds of custom clothing manufacturer. welcome you to come to our china clothing manufacturer and clothing factory.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>