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/761e03ab19788c1468ee7f720ce8c557%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to