AR_Extension help

K

Ken Ghosh

I using ar_extensions for mass insertions I found it very effective

all I want is to cache the inserted records into the variable when they
are inserted

something of this kind for a single insert command

cached_record = []
records.each_with_index do |record,i|
cached_record << Record.create:)name => record,:value => i)
end

so that I don't have to look up in database for the inserted records as
I have them on the fly

is the above kind of code can used with ar_extenions or any other
options

so that when I do
"Record.import()" for mass insertion of the records. The records can
also be cache into a variable

same as above

Note : I don't want to lookup in database as my database is huge
crossing over five million records so looking up for the inserted
records
e.g
cached_record << Record.all
that a long amount of time close to 20 min

and I don't need that

Thanks anyway
 
R

Roger Pack

so that when I do
"Record.import()" for mass insertion of the records. The records can
also be cache into a variable

Perhaps you can save them to your cache before passing them into the
import call? (sorry, don't use ar_extensions all that much).
-r
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top