# Turn Massive Array into new Objects

**URL:** <https://www.ruby-forum.com/t/turn-massive-array-into-new-objects/169015>\
**Category:** Rails\
**Created:** [May 28, 2009, 12:54pm UTC](https://www.ruby-forum.com/t/turn-massive-array-into-new-objects/169015 "2009-05-28T12:54:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/6de8d8/32.png) [@nik](https://www.ruby-forum.com/u/nik)\
**Post date:** [May 28, 2009, 12:54pm UTC](https://www.ruby-forum.com/t/turn-massive-array-into-new-objects/169015/1 "2009-05-28T12:54:28Z")

</div>

Hello,

So I have this massive array 10k+ items in it  
b  
=\>[“aaa”,“aab”,…,“aba”,“abb”,…“zza”,“zzb”,“zzc”,…,“zzz”]

I need to save them in the Bakery model  
I tried to do  
Bakery.find(1)  
=\>{:id=\>1, :name =\> “afe”}

b.each do |x|  
Bakery.new do |b|  
b.name = x  
end  
end

I know my home computer can’t really beat a server grade machine, but  
it still took nearly a minute to process. Is there anyway that this  
can be faster?

Thanks!

---

<div class="post-metadata">

**Author:** ![nik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/6de8d8/32.png) [@nik](https://www.ruby-forum.com/u/nik)\
**Post date:** [May 28, 2009, 12:55pm UTC](https://www.ruby-forum.com/t/turn-massive-array-into-new-objects/169015/2 "2009-05-28T12:55:04Z")

</div>

Oops, I mean  
b.each do |x|  
Bakery.new do |y|  
y.name = x  
end  
end
