Hi guys, I''m new with RoR, and so far I''m loving it. I got a question: ¿How is the most efficient way to insert 1000 records on the same table? I''m trying to insert allot of "items" on the same table, but, right now I''m creating an "item" object, with the data, and then call item.save. ¿Is there any other way to do this more efficiently? P.S: I don''t need validation, etc.. Thanks for all, :) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On May 17, 3:24 pm, saptah <sap...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi guys, > I''m new with RoR, and so far I''m loving it. > I got a question: ¿How is the most efficient way to insert 1000 > records on the same table? > I''m trying to insert allot of "items" on the same table, but, right > now I''m creating an "item" object, with the data, and then call > item.save. > > ¿Is there any other way to do this more efficiently? > P.S: I don''t need validation, etc.. >Write some custom sql to insert rows several at a time. The ar- extensions gem does this if my memory is correct Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Hi! Thanks for the answer. I''ve been reading, and I think this is just want I need. Thanks again. On May 17, 6:27 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On May 17, 3:24 pm, saptah <sap...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi guys, > > I''m new with RoR, and so far I''m loving it. > > I got a question: ¿How is the most efficient way to insert 1000 > > records on the same table? > > I''m trying to insert allot of "items" on the same table, but, right > > now I''m creating an "item" object, with the data, and then call > > item.save. > > > ¿Is there any other way to do this more efficiently? > > P.S: I don''t need validation, etc.. > > Write some custom sql to insert rows several at a time. The ar- > extensions gem does this if my memory is correct > > Fred > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.