This project is archived and is in readonly mode.

#3489 ✓invalid
Mislav

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

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>

People watching this ticket

Pages