Please, You not fetch all rows from database table. For better way is, you can fetch data with filter using 'where' cluase and Proceed on data.
On Wednesday, June 12, 2013 11:08:16 AM UTC+5:30, Ruby-Forum.com User wrote: > > Rails 4.0.0 > > I am developing an app that checkes information updates automatically. > When the checking algorithms get to work, they receive an array of > contents such as > > info_obtained: ['Tom', 'Steven', 'Bill', ...] > > then, the app needs to check if each element of the array is already > persisted in the database. > > Of course, I can loop through all elements like > > Info.all.each do | i | > if i == ... then > Info.create(... => i) > end > end > > But it seems inefficient. > > Is there better ways or gems that do the job I am looking for? > > soichi > > -- > Posted via http://www.ruby-forum.com/. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9d5f8f97-e5f6-4fca-b0a1-06da70e2535b%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.

