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 -- Posted via http://www.ruby-forum.com/.
On 11/22/05, Shaun <sszot-e50bGt9CDiaVc3sceRu5cw@public.gmane.org> 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. > > ShaunFoo.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 <sszot-e50bGt9CDiaVc3sceRu5cw@public.gmane.org> 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.netJust what I was looking for. Thanks Rick. -- Posted via http://www.ruby-forum.com/.