Soichi Ishida wrote in post #1112146: > Rails 4.0.0 > 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
Not sure I understand fully your problem. Maybe use find_in_batches ? http://api.rubyonrails.org/classes/ActiveRecord/Batches.html or find_and_create_by_column_name ? http://api.rubyonrails.org/classes/ActiveRecord/Base.html -- 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/d3b90fba117222650aa028cc2dbc357f%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.

