How to delete a set of records

I’m trying to delete a set of records from the database using parameters
other than the primary key. Is there a method similar to find_by_sql()
that can be used to issue a delete statement like this. Thanks in
advance.

Shaun

On 11/22/05, Shaun [email protected] wrote:

I’m trying to delete a set of records from the database using parameters
other than the primary key. Is there a method similar to find_by_sql()
that can be used to issue a delete statement like this. Thanks in
advance.

Shaun

Foo.destroy_all ‘bar < 5’

http://rails.rubyonrails.com/classes/ActiveRecord/Base.html#M000698


rick
http://techno-weenie.net

technoweenie wrote:

On 11/22/05, Shaun [email protected] wrote:

I’m trying to delete a set of records from the database using parameters
other than the primary key. Is there a method similar to find_by_sql()
that can be used to issue a delete statement like this. Thanks in
advance.

Shaun

Foo.destroy_all ‘bar < 5’

Peak Obsession


rick
http://techno-weenie.net

Just what I was looking for. Thanks Rick.