Greg Hauptmann
2008-Jun-21 04:33 UTC
how can I drop all table data in one hit, from within ruby code (controller or model)?
how can I drop all table data in one hit, from within ruby code (controller or model)? (i.e. prior to updating my projections table I need to delete all existing data first) thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
gberz3
2008-Jun-21 04:37 UTC
Re: how can I drop all table data in one hit, from within ruby code (controller or model)?
Are you looking for this: http://railsapi.org/activerecord-base-delete_all Basically, delete_all should do what you''re asking. HTH On Jun 21, 12:33 am, "Greg Hauptmann" <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> how can I drop all table data in one hit, from within ruby code (controller > or model)? (i.e. prior to updating my projections table I need to delete all > existing data first) > > thanks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---