Active Record Delete if not in

Hy!

How can i delete from an AR Object the opposite way like the following:

Song.destroy( 10, 11, 20 )
SQL = DELETE FROM songs WHERE id IN (10,11,20)

I need

Song.destroy everthing but 10,11,12

SQL = DELETE FROM songs WHERE id NOT IN (10,11,20)

thx CK

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs